| Summary: | NullPointerException on maven project import | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Matthew Adams <matthew> |
| Component: | m2e | Assignee: | Igor Fedorenko <igor> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | igor |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Matthew Adams
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 |