tags:

views:

2004

answers:

4

I have created a Dynamic Web Project in my Eclipse workspace. It is a also a Maven project, and under SVN control. But in "Open Resource" (Ctrl+Alt+R) no file from this project appears, unless I check from the window's options (top right drop-down) "Show Derived Resources".

I have checked on some of the project's folders and they are not marked as "Derived".

I have two more (plain Java) projects in the workspace, and all the files from them are visible in "Open Resource".

Do you know what might be wrong with either Eclipse, the Maven plugin or Subeclipse (the SVN plugin)?

Thanks,

Marius

+3  A: 

I experienced a similar issue in Eclipse (Ganymede), when using the Maven and Subeclipse plugins. I have not determined which plugin caused this problem, but I suspect that it is related to my pom.xml containing nested modules (ie. a main-moduleintegration-test). These appear in Eclipse as nested folders with their own pom.xml files (I did not use the Multiple Projects plugin although I have installed it).

I assume that one of the plug-ins has incorrectly set the derived flag on these folders when I checked out the project by SVN and then updated the MVN dependencies and project settings.

When I right click->properties on the top-level nested module directories I can see the Derived flag is checked. By unchecking the derive flag on the module directories (and checking the derive flag on the target directories within each sub-module instead), it fixed the Open Resource functionality.

As the derived flag is inherited from directories, you may need to check all of your directories in the hierarchy to find the 'culprit'.

If it helps the plug-in authors, my top level module directories contain a hyphen '-' in their names. Maybe that is throwing out one of the plugins.

Cheers,

Alex

Thanks Alex, hand-marking my "target" directories as derived did the trick. A bit manual, but it worked :)
+1  A: 

I think it is the maven plugin:

Jira issue

See also the notes for July 31, 2008 at the New and Noteworthy page for m2eclipse.

Several other nice links deleted because of restrictions of stackoverflow.

Patrick Forhan
A: 

Late reply - not trying to hijack a thread.

I can confirm that the problem is with m2eclipse since I'm seeing this problem and don't have subclipse installed.

Michael Willer
A: 

In fact, I think that somehow this is eclipse in its own right, as I don't have m2eclipse or using maven for this.

By default, eclipse uses /bin as the target directory. My situation is similar to having maven in the project in that the target directory was changed to lib/classes to accommodate an existing project.

I started seeing issues similar to what is reported here, and while searching for the problem, came across this solution. Eclipse somehow didn't "uncheck" the bin directory as no longer derived, so I ran into the same issues. I tried replicating it, but I couldn't.

Spencer K