Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366141

Summary: NPE in org.maven.ide.eclipse.wtp.WTPProjectsUtil.isQualifiedAsWebFragment(WTPProjectsUtil.java:462)
Product: z_Archived Reporter: Gabriel Forro <gabriel.forro>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: minor    
Priority: P3 CC: igor, sebtardif
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Stacktrace from the eclipse's log file none

Description Gabriel Forro CLA 2011-12-09 02:42:37 EST
Build Identifier: 201111221000

The m2e plugin fails with a NullPointerException when the "Update project configuration..." action is selected from the Maven context menu on a project in Eclipse. 
This happens when there is a resource in pom.xml with a relative directory path outside of the maven project. Like:
<resource>
  <directory>../another-module/src/main/resource</directory>
</resource>
It also happens when the the ${basedir} maven property is used in the directory definition:
<resource>
  <directory>${basedir}/../another-module/src/main/resource</directory>
</resource>


Possible workaround to prevent the NPE is to use the following definition:
<resource>
  <directory>${project.build.directory}/../../another-module/src/main</directory>
</resource>


Reproducible: Always

Steps to Reproduce:
1. Define a resource in your pom.xml which is outside of your maven project (see the Details section) - for example a file from an another maven project module
2. Select the "Maven -> Update project configuration..." context menu on the project
3. The m2e fails with the reported NPE
Comment 1 Gabriel Forro CLA 2011-12-09 02:45:43 EST
Created attachment 208137 [details]
Stacktrace from the eclipse's log file
Comment 2 Gabriel Forro CLA 2011-12-09 02:49:46 EST
m2e plugin version, where the problem occurs: 1.0.100.20110804-1717
Comment 3 Gabriel Forro CLA 2011-12-09 02:50:10 EST
The bug has been already reported in:
https://jira.codehaus.org/browse/MECLIPSE-701
Comment 4 Igor Fedorenko CLA 2011-12-09 07:13:44 EST
please report m2e/wtp integration problems to https://issues.sonatype.org/browse/MECLIPSEWTP
Comment 5 Gabriel Forro CLA 2011-12-09 09:10:12 EST
Reported in https://issues.sonatype.org/browse/MECLIPSEWTP as it has been suggested.
See:
https://issues.sonatype.org/browse/MECLIPSEWTP-193
Comment 6 Denis Roy CLA 2021-04-19 13:26:20 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/