This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 191176 - "Misconfigured maven project" when property exists in system-scoped dependency's systemPath
Summary: "Misconfigured maven project" when property exists in system-scoped dependenc...
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 154507 191309 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-20 13:31 UTC by karbonized
Modified: 2010-10-25 16:30 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description karbonized 2010-10-20 13:31:42 UTC
In the project's pom.xml, I specify a dependency to JDK's "tools.jar" with system scope:

<dependency>
  <groupId>com.sun</groupId>
  <artifactId>tools</artifactId>
  <version>1.6</version>
  <scope>system</scope>
  <systemPath>${jdk16_x86_Path}/lib/tools.jar</systemPath>
</dependency>

The property jdk16_x86_Path is defined in the current user's private settings.xml (under $HOME/.m2/settings.xml as follows:

<jdk16_x86_Path>/usr/lib/jvm/java-6-sun</jdk16_x86_Path>

However Netbeans complains about a system-scoped dependency having a relative path while the project can be built successfully (and obviously maven is happy with this). When I substitute the property with its actual value in the project's pom.xml, Netbeans is OK with it.

This bug appeared in NB 7.0 M2 - in 6.9 and previous 6.10 development build it was working fine.
Comment 1 Jesse Glick 2010-10-20 15:06:18 UTC
Probably related to bug #154507, though that deals with environment variables.

(In reply to comment #0)
> the project can be built successfully (and obviously maven is happy with this)

Don't be too sure. At least in the case of Maven plugins, you cannot run a plugin whose POM included a system-scope dependency of relative path, even when the plugin could be built from source just fine: other Maven processes (perhaps on someone else's machine) will read the *.pom from the local repo, see an unevaluated property or invalid relative path, and choke. Not sure if this problem applies to other usages of a built artifact.

I would recommend trying ${java.home}/../lib/tools.jar (perhaps controlled by a profile) rather than relying on a path in settings.xml, at least until there is some resolution to <http://jira.codehaus.org/browse/MNG-1867>.
Comment 2 Jesse Glick 2010-10-20 17:12:13 UTC
Reproducible, but so far I have no clue where this is supposed to be fixed. MavenEmbedder does call MavenExecutionRequest.setUserSettingsFile with the expected value.
Comment 3 Jesse Glick 2010-10-20 17:56:17 UTC
*** Bug 154507 has been marked as a duplicate of this bug. ***
Comment 4 Jesse Glick 2010-10-20 18:00:33 UTC
core-main #ee31298e328a
Comment 5 Jesse Glick 2010-10-25 16:30:54 UTC
*** Bug 191309 has been marked as a duplicate of this bug. ***