Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366141 - NPE in org.maven.ide.eclipse.wtp.WTPProjectsUtil.isQualifiedAsWebFragment(WTPProjectsUtil.java:462)
Summary: NPE in org.maven.ide.eclipse.wtp.WTPProjectsUtil.isQualifiedAsWebFragment(WTP...
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 02:42 EST by Gabriel Forro CLA
Modified: 2021-04-19 13:26 EDT (History)
2 users (show)

See Also:


Attachments
Stacktrace from the eclipse's log file (1.02 KB, application/octet-stream)
2011-12-09 02:45 EST, Gabriel Forro CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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/