Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [MWE] DirectoryCleaner not working when called from parent project with Maven
[MWE] DirectoryCleaner not working when called from parent project with Maven [message #493624] |
Tue, 27 October 2009 06:15  |
Eclipse User |
|
|
|
I hope this is the right forum for my question, tell me if there is a better one...
We are facing an issue with org.eclipse.emf.mwe.utils.DirectoryCleaner. We have configured it in our workflow files to remove the directories before re-generating all the stuff.
Additionally, we use Maven to build the projects and the Fornax plugin to call the workflows during the build. All this is fine.
There is a multi-module project A that aggregates projects B, C, ..., and these are the ones that contain the modeling stuff (DSL files, workflow files etc.). Now, when we call the build from inside a subproject, say B, everything is fine. But when we start the build of A, B and C will be built as well and the workflows are executed, but DirectoryCleaner is not removing anything.
By adding some debugging code, we found out that in invokeInternal() method the created File has the same absolute path -- f.getAbsolutePath() -- in both scenarios, but f.exists() reveals false when the workflow is called from the outer project. I would expect that this method takes into account the absolute path, but that's obviously not the case.
We fixed it by using something like this:
...
final File f = new File(dir);
f = new File(f.getAbsolutePath());
...
before testing if the file exists and is a directory. All of this is quite strange, I think, and I wonder if anybody else experiences the same issue (we have JDK 1.5.0_16 with Windows, BTW).
Would the given fix be a reasonable workaround worth to make it into the code?
Thanks,
Christoph.
[Updated on: Tue, 27 October 2009 06:15] by Moderator
|
|
|
Re: [MWE] DirectoryCleaner not working when called from parent project with Maven [message #494366 is a reply to message #493624] |
Fri, 30 October 2009 08:23  |
Eclipse User |
|
|
|
Hi Christoph,
this sounds like a bug. Please file a ticket and attach the patch. We'ld
be happy to review it.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Christoph schrieb:
> I hope this is the right forum for my question, tell me if there is a
> better one...
>
> We are facing an issue with org.eclipse.emf.mwe.utils.DirectoryCleaner.
> We have configured it in our workflow files to remove the directories
> before re-generating all the stuff.
>
> Additionally, we use Maven to build the projects and the Fornax plugin
> to call the workflows during the build. All this is fine.
> There is a multi-module project A that aggregates projects B, C, ...,
> and these are the ones that contain the modeling stuff (DSL files,
> workflow files etc.). Now, when we call the build from inside a
> subproject, say B, everything is fine. But when we start the build of A,
> B and C will be built as well and the workflows are executed, but
> DirectoryCleaner is not removing anything.
>
> By adding some debugging code, we found out that in invokeInternal()
> method the created File has the same absolute path --
> f.getAbsolutePath() -- in both scenarios, but f.exists() reveals false
> when the workflow is called from the outer project. I would expect that
> this method takes into account the absolute path, but that's obviously
> not the case.
>
> We fixed it by using something like this:
> ...
> final File f = new File(dir);
> f = new File(f.getAbsolutePath());
> ...
> before testing if the file exists and is a directory. All of this is
> quite strange, I think, and I wonder if anybody else experiences the
> same issue (we have JDK 1.5.0_16 with Windows, BTW).
> Would the given fix be a reasonable workaround worth to make it into the
> code?
>
> Thanks,
> Christoph.
|
|
|
Goto Forum:
Current Time: Wed Jul 23 16:01:26 EDT 2025
Powered by FUDForum. Page generated in 0.04416 seconds
|