Community
Participate
Working Groups
Getting NPE upon eclipse import of existing maven project. I've seen this in several projects, but this one's easy to reproduce. Steps to reproduce: 1. Checkout code via command: svn co https://svn.apache.org/repos/asf/db/jdo/trunk/api 2. Start eclipse 3. Import project via File/Import/Existing Maven Projects, selecting the directory into which you checked out code in step 1. 4. Observe NPE.
m2e chokes on the following <resource/> element. <resource> <targetPath>META-INF</targetPath> <directory>${basedir}/..</directory> <includes> <include>NOTICE.txt</include> </includes> </resource> Please note that m2e will NOT fully support resources outside of project's ${basedir} and the fill will be to ignore such resource elements.
(In reply to comment #1) > m2e chokes on the following <resource/> element. > > <resource> > <targetPath>META-INF</targetPath> > <directory>${basedir}/..</directory> > <includes> > <include>NOTICE.txt</include> > </includes> > </resource> > > > Please note that m2e will NOT fully support resources outside of project's > ${basedir} and the fill will be to ignore such resource elements. Fair enough, although I would ask why. It doesn't seem particularly out of the ordinary to use a path element like ".." to go up past ${basedir}. Should that be a separate enhancement request?
(In reply to comment #2) > Fair enough, although I would ask why. It doesn't seem particularly out of the > ordinary to use a path element like ".." to go up past ${basedir}. Should that > be a separate enhancement request? There are two side of this. The code that fails with NPE only deals with visual representation of <resource/> elements as java sources folder in Package explorer. I do not believe JDT model directly supports source folders outside of project ${basedir} and I don't believe more complicated solution is justified just to make the project look pretty in Package explorer. The code that does resource processing, most likely won't work for resources outside of project ${basedir} either. Your original bugreport actually highlights the reason I don't believe using such resources is generally a good idea (hint: svn co trunk/api won't have expected ${basedir}/..). Some developers suggested use of maven-remote-resources-plugin to share resources across multiple maven projects, but I have not had a chance to fully think this through. See also bug 344722, which is directly related to processing of resources outside of project ${basedir}.
Should be fixed now. http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=a2746ff3c675e44492669833691d5a040a8465ff https://github.com/sonatype/m2e-core-tests/commit/d17378b30813f73e94e767f749c03053db9731c8
Moved to https://github.com/eclipse-m2e/m2e-core/issues/