Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 #621520] Tue, 27 October 2009 10:15 Go to next message
Christoph  is currently offline Christoph Friend
Messages: 16
Registered: July 2009
Junior Member
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.
Re: [MWE] DirectoryCleaner not working when called from parent project with Maven [message #621538 is a reply to message #621520] Fri, 30 October 2009 12:23 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3109
Registered: July 2009
Senior Member
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.
Previous Topic:[MWE] DirectoryCleaner not working when called from parent project with Maven
Next Topic:Open (load) emf file
Goto Forum:
  


Current Time: Sun Jun 20 08:23:13 GMT 2021

Powered by FUDForum. Page generated in 0.01939 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top