Maven 2 & 3

system path dependencies are not resolved

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 2.1.0
  • Fix Version/s: None
  • Component/s: POM
  • Labels:
    None
  • Environment:
    Windows Vista
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

If a system path dependency is used, the depencies are not included.

I cannot build my project anymore and I'm stuck.

This is the error I get:

[WARNING] POM for 'net.sf:microlog-instrument:pom:1.1.1:compile' is invalid.

Its dependencies (if any) will NOT be available to the current build.
[DEBUG] Reason: Failed to validate POM for project net.sf:microlog-instrument at
Artifact [net.sf:microlog-instrument:pom:1.1.1:compile]
[DEBUG]
Validation Errors:
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr21 1, version=2.2, type=jar}: system-scoped dependency must specify an absolute pat
h systemPath.
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr08 2, version=2.2, type=jar}: system-scoped dependency must specify an absolute pat
h systemPath.
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr75 , version=2.2, type=jar}: system-scoped dependency must specify an absolute path
systemPath.
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=wma20 , version=2.2, type=jar}: system-scoped dependency must specify an absolute path
systemPath.

Issue Links

Activity

Hide
Benjamin Bentmann added a comment -

system-scoped dependency must specify an absolute path systemPath.

In your POM I see {{<systemPath>${wtk.home}/lib/jsr211.jar</systemPath>}}. The error message suggests that the property wtk.home was not resolved (hence no absolute path) so you should check your environmental setup.

Show
Benjamin Bentmann added a comment -
system-scoped dependency must specify an absolute path systemPath.
In your POM I see {{<systemPath>${wtk.home}/lib/jsr211.jar</systemPath>}}. The error message suggests that the property wtk.home was not resolved (hence no absolute path) so you should check your environmental setup.
Hide
Karsten Ohme added a comment -

The variable is set. I did not unset it before installing Maven 2.1.0

It iscontained in a properties section:

<wtk.home>${env.WTK_HOME}</wtk.home>

echo %WTK_HOME%
C:\WTK2.5.1

Something must have been improved from 2.0.9 to 2.1.0.

Show
Karsten Ohme added a comment - The variable is set. I did not unset it before installing Maven 2.1.0 It iscontained in a properties section: <wtk.home>${env.WTK_HOME}</wtk.home> echo %WTK_HOME% C:\WTK2.5.1 Something must have been improved from 2.0.9 to 2.1.0.
Hide
Benjamin Bentmann added a comment -

Hm, how does a minimal POM that does not inherit from any parent but declares the wtk.home property and the system dependency itself work for you? Just trying to figure out whether inheritance plays a role or not.

The other thing interesting to test might be to outcomment the system dependency in this minimal POM and check the output of "mvn help:effective-pom" shows the value of the wtk.home property as expected.

Show
Benjamin Bentmann added a comment - Hm, how does a minimal POM that does not inherit from any parent but declares the wtk.home property and the system dependency itself work for you? Just trying to figure out whether inheritance plays a role or not. The other thing interesting to test might be to outcomment the system dependency in this minimal POM and check the output of "mvn help:effective-pom" shows the value of the wtk.home property as expected.
Hide
Karsten Ohme added a comment -

I get with mvn help:effective-pom:

<dependency>
<groupId>j2me</groupId>
<artifactId>mmapi</artifactId>
<version>10</version>
<scope>system</scope>
<systemPath>C:\WTK2.5.1/lib/mmapi.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sun.wtk</groupId>
<artifactId>wma20</artifactId>
<version>2.2</version>
<scope>system</scope>
<systemPath>C:\WTK2.5.1/lib/wma20.jar</systemPath>
</dependency>
<dependency>
<groupId>j2me</groupId>
<artifactId>midp</artifactId>
<version>20</version>
<scope>system</scope>
<systemPath>C:\WTK2.5.1/lib/midpapi20.jar</systemPath>
</dependency>
<dependency>
<groupId>j2me</groupId>
<artifactId>cldc</artifactId>
<version>11</version>
<scope>system</scope>
<systemPath>C:\WTK2.5.1/lib/cldcapi11.jar</systemPath>
</dependency>
<dependency>
<groupId>javax.microedition.location</groupId>
<artifactId>jsr179</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>C:\WTK2.5.1/lib/jsr179.jar</systemPath>
</dependency>

The path separators are different. Maybe this is the problem.

Show
Karsten Ohme added a comment - I get with mvn help:effective-pom: <dependency> <groupId>j2me</groupId> <artifactId>mmapi</artifactId> <version>10</version> <scope>system</scope> <systemPath>C:\WTK2.5.1/lib/mmapi.jar</systemPath> </dependency> <dependency> <groupId>com.sun.wtk</groupId> <artifactId>wma20</artifactId> <version>2.2</version> <scope>system</scope> <systemPath>C:\WTK2.5.1/lib/wma20.jar</systemPath> </dependency> <dependency> <groupId>j2me</groupId> <artifactId>midp</artifactId> <version>20</version> <scope>system</scope> <systemPath>C:\WTK2.5.1/lib/midpapi20.jar</systemPath> </dependency> <dependency> <groupId>j2me</groupId> <artifactId>cldc</artifactId> <version>11</version> <scope>system</scope> <systemPath>C:\WTK2.5.1/lib/cldcapi11.jar</systemPath> </dependency> <dependency> <groupId>javax.microedition.location</groupId> <artifactId>jsr179</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>C:\WTK2.5.1/lib/jsr179.jar</systemPath> </dependency> The path separators are different. Maybe this is the problem.
Hide
Benjamin Bentmann added a comment -

If you get this via "mvn help:effective-pom", you have already passed the point where it would otherwise bail out (model validation). Hence, the different file separators are not the problem. Assuming you got this output from the minimal POM I described earlier, I assume inheritance and/or dependency management play a role here.

Show
Benjamin Bentmann added a comment - If you get this via "mvn help:effective-pom", you have already passed the point where it would otherwise bail out (model validation). Hence, the different file separators are not the problem. Assuming you got this output from the minimal POM I described earlier, I assume inheritance and/or dependency management play a role here.
Hide
Karsten Ohme added a comment -

Th maven code which does this tries to locate the fiel with a File().exists(). The warning is thrown there.
(file maven/project/DefaultValidatorModel.java)

Show
Karsten Ohme added a comment - Th maven code which does this tries to locate the fiel with a File().exists(). The warning is thrown there. (file maven/project/DefaultValidatorModel.java)
Hide
Karsten Ohme added a comment -

[WARNING] POM for 'net.sf:microlog-instrument:pom:1.1.1:compile' is invalid.

Its dependencies (if any) will NOT be available to the current build.
[DEBUG] Reason: Failed to validate POM for project net.sf:microlog-instrument at
Artifact [net.sf:microlog-instrument:pom:1.1.1:compile]
[DEBUG]
I have build the current Maven snapshot and modified the code to see what DefaultValidatorModel.java does:

Validation Errors:
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr21 1, version=2.2, type=jar}: system-scoped dependency must specify an absolute pat
h ${env.WTK_HOME}/lib/jsr211.jar.
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr08 2, version=2.2, type=jar}: system-scoped dependency must specify an absolute pat
h ${env.WTK_HOME}/lib/jsr082.jar.
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr75 , version=2.2, type=jar}: system-scoped dependency must specify an absolute path
${env.WTK_HOME}/lib/jsr75.jar.
[DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=wma20 , version=2.2, type=jar}: system-scoped dependency must specify an absolute path
${env.WTK_HOME}/lib/wma20.jar.
[DEBUG]

The variable is not resolved at runtime. Maybe this is related to MNG-4182.

Show
Karsten Ohme added a comment - [WARNING] POM for 'net.sf:microlog-instrument:pom:1.1.1:compile' is invalid. Its dependencies (if any) will NOT be available to the current build. [DEBUG] Reason: Failed to validate POM for project net.sf:microlog-instrument at Artifact [net.sf:microlog-instrument:pom:1.1.1:compile] [DEBUG] I have build the current Maven snapshot and modified the code to see what DefaultValidatorModel.java does: Validation Errors: [DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr21 1, version=2.2, type=jar}: system-scoped dependency must specify an absolute pat h ${env.WTK_HOME}/lib/jsr211.jar. [DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr08 2, version=2.2, type=jar}: system-scoped dependency must specify an absolute pat h ${env.WTK_HOME}/lib/jsr082.jar. [DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=jsr75 , version=2.2, type=jar}: system-scoped dependency must specify an absolute path ${env.WTK_HOME}/lib/jsr75.jar. [DEBUG] For managed dependency Dependency {groupId=com.sun.wtk, artifactId=wma20 , version=2.2, type=jar}: system-scoped dependency must specify an absolute path ${env.WTK_HOME}/lib/wma20.jar. [DEBUG] The variable is not resolved at runtime. Maybe this is related to MNG-4182.
Hide
Norbert Truchsess added a comment -

here's something I found out:

I have system-scoped dependency in my pom.xml:

<dependency>
<groupId>weblogic</groupId>
<artifactId>wls-api</artifactId>
<version>${weblogic.version}</version>
<scope>system</scope>
<systemPath>${weblogic.home}/server/lib/wls-api.jar</systemPath>
</dependency>

If I specify weblogic-home in settings.xml profile:

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<weblogic.home>C:\localdata\lib\bea\wlserver_10.0</weblogic.home>
</properties>
</profile>
</profiles>

it fails to resolve and I get the same warning:
[WARNING] POM for '....' is invalid.
Its dependencies (if any) will NOT be available to the current build.

But if I specify the same property via -D-parameter on the mvn commandline
mvn -Dweblogic.home=c:\\localdata
weblogic
then it's going to be resolved and it builds without errors.

Show
Norbert Truchsess added a comment - here's something I found out: I have system-scoped dependency in my pom.xml: <dependency> <groupId>weblogic</groupId> <artifactId>wls-api</artifactId> <version>${weblogic.version}</version> <scope>system</scope> <systemPath>${weblogic.home}/server/lib/wls-api.jar</systemPath> </dependency> If I specify weblogic-home in settings.xml profile: <profiles> <profile> <id>default</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <weblogic.home>C:\localdata\lib\bea\wlserver_10.0</weblogic.home> </properties> </profile> </profiles> it fails to resolve and I get the same warning: [WARNING] POM for '....' is invalid. Its dependencies (if any) will NOT be available to the current build. But if I specify the same property via -D-parameter on the mvn commandline mvn -Dweblogic.home=c:\\localdata
weblogic then it's going to be resolved and it builds without errors.
Hide
Benjamin Bentmann added a comment -

Norbert, the cause for your issue is captured by MNG-4148.

Show
Benjamin Bentmann added a comment - Norbert, the cause for your issue is captured by MNG-4148.
Hide
Brett Porter added a comment -

superceded by linked issue

Show
Brett Porter added a comment - superceded by linked issue

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: