Maven 2 & 3

System scope dependencies in parent POM cause validation warnings for most plugins and errors in assembly plugin

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Duplicate
  • Affects Version/s: 2.0-alpha-1
  • Fix Version/s: None
  • Component/s: Errors
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    3

Description

When system scope dependencies are in a parent POM and the systemPath for those variables contain a variable to be interpolated as a root path, maven throws off a lot of spurious warnings that the POM does not validate because system paths need to be absolute. An example of this in a parent POM (where ${jboss.home} is defined in ~/.m2/settings.xml):



<dependency>
<groupId>jboss</groupId>
<artifactId>activation</artifactId>
<version>4.0.4.GA</version>
<scope>system</scope>
<systemPath>${jboss.home}/server/default/lib/activation.jar</systemPath>
</dependency>


In discussing this with John and Jason online, both apparently have generic implementations that can go in at some point, but this is something I would like to get into 2.0.5. The patch is ~25 lines of new code with one replaced.

It's marked as blocker because we use the assembly plugin, which fails the build on the validation problem where most other plugins just enumerate every system scope dependency. For now, I will distribute the patched version around the company though

thanks

  1. interpolation.patch
    20/Oct/06 7:34 PM
    4 kB
    Brian Topping
  2. interpolation-good.patch
    07/Nov/06 5:29 PM
    5 kB
    Brian Topping
  3. MNG-2626it.tgz
    02/Nov/06 1:23 PM
    21 kB
    Brian Topping

Issue Links

Activity

Hide
Brian Topping added a comment -

Hmm, that XML was supposed to be as follows:

<dependency>
			<groupId>jboss</groupId>
			<artifactId>activation</artifactId>
			<version>4.0.4.GA</version>
			<scope>system</scope>
			<systemPath>${jboss.home}/server/default/lib/activation.jar</systemPath>
		</dependency>
Show
Brian Topping added a comment - Hmm, that XML was supposed to be as follows:
<dependency>
			<groupId>jboss</groupId>
			<artifactId>activation</artifactId>
			<version>4.0.4.GA</version>
			<scope>system</scope>
			<systemPath>${jboss.home}/server/default/lib/activation.jar</systemPath>
		</dependency>
Hide
Jon added a comment -

Please accept this patch as soon as possible as I really don't feel like having to install Brian's hacked version on my box. Who knows what sort of crazy shit backdoors he included in it.

Thank you.

jon

Show
Jon added a comment - Please accept this patch as soon as possible as I really don't feel like having to install Brian's hacked version on my box. Who knows what sort of crazy shit backdoors he included in it. Thank you. jon
Hide
Brian Topping added a comment -

integration test basis

Show
Brian Topping added a comment - integration test basis
Hide
Brian Topping added a comment -

I LOVE PATCHES! They are especially lovely when you don't realize for weeks that all of the files did not get included. grr...

File #3 is the correct patch. The first patch does not have the projectBuilder.setSettings( request.getSettings() ); call in DefaultMaven.java

Show
Brian Topping added a comment - I LOVE PATCHES! They are especially lovely when you don't realize for weeks that all of the files did not get included. grr... File #3 is the correct patch. The first patch does not have the projectBuilder.setSettings( request.getSettings() ); call in DefaultMaven.java
Hide
Brian Fox added a comment -

Can we get updated patches and ITs for this? I can try to get it into 2.0.8

Show
Brian Fox added a comment - Can we get updated patches and ITs for this? I can try to get it into 2.0.8
Hide
Torben S. Giesselmann added a comment -

Has this been fixed? I can't reproduce the problem; works perfectly with 2.0.11-SNAPSHOT.

Show
Torben S. Giesselmann added a comment - Has this been fixed? I can't reproduce the problem; works perfectly with 2.0.11-SNAPSHOT.
Hide
Cimballi added a comment -

On my side, the problem is still present.
I have a main POM, and one of the modules as a system dependency, and it generates the "system-scoped dependency must specify an absolute path systemPath." error.
The dependency is not present in the main POM, only in the POM of the module.

I tested with versions "apache-maven-2.0.11-20090213.232410-1" and "apache-maven-2.1.0".

Show
Cimballi added a comment - On my side, the problem is still present. I have a main POM, and one of the modules as a system dependency, and it generates the "system-scoped dependency must specify an absolute path systemPath." error. The dependency is not present in the main POM, only in the POM of the module. I tested with versions "apache-maven-2.0.11-20090213.232410-1" and "apache-maven-2.1.0".
Hide
Benjamin Bentmann added a comment -

Cimballi, can you provide a test project to easily demonstrate your issue?

Show
Benjamin Bentmann added a comment - Cimballi, can you provide a test project to easily demonstrate your issue?
Hide
Cimballi added a comment -

Well, sorry guys, it was a false alarm. I was using a property in the path and the property was not well setted. It works well with 2.0.9, 2.0.11 and 2.1.0.

Show
Cimballi added a comment - Well, sorry guys, it was a false alarm. I was using a property in the path and the property was not well setted. It works well with 2.0.9, 2.0.11 and 2.1.0.
Hide
Gabriel added a comment -

Has any accepted solution for this bug or another related open bug?

Im trying to create these maven projects:

  • WebSphere 6.1 Runtime Libraries (using system scoped dependency path ${was61.home}/lib/XXXX.jar from developer machine settings.xml)
  • WebSphere 5.1 Runtime Libraries (using system scoped dependency path ${was51.home}/lib/YYYY.jar from developer machine settings.xml)
  • JBoss 4 Runtime Libraries ... (using system scoped dependency ...)
  • JBoss 5 Runtime Libraries ..(using system scoped dependency ...)
  • "My Framework" Libraries ...
  • "My Portal" Runtime Libraries ...

to use with our corporate applications:

MyApp01 depends 'WebSphere 6.1 Runtime Libraries' and 'My Framework Libraries'
MyApp02 depends 'WebSphere 5.1 Runtime Libraries' and 'My Portal Runtime Libraries'

but with maven (2.0 and 2.1) we are getting error:

"system-scoped dependency must specify an absolute path systemPath." for every system scoped dependency on imported POM.xml

Show
Gabriel added a comment - Has any accepted solution for this bug or another related open bug? Im trying to create these maven projects:
  • WebSphere 6.1 Runtime Libraries (using system scoped dependency path ${was61.home}/lib/XXXX.jar from developer machine settings.xml)
  • WebSphere 5.1 Runtime Libraries (using system scoped dependency path ${was51.home}/lib/YYYY.jar from developer machine settings.xml)
  • JBoss 4 Runtime Libraries ... (using system scoped dependency ...)
  • JBoss 5 Runtime Libraries ..(using system scoped dependency ...)
  • "My Framework" Libraries ...
  • "My Portal" Runtime Libraries ...
to use with our corporate applications: MyApp01 depends 'WebSphere 6.1 Runtime Libraries' and 'My Framework Libraries' MyApp02 depends 'WebSphere 5.1 Runtime Libraries' and 'My Portal Runtime Libraries' but with maven (2.0 and 2.1) we are getting error: "system-scoped dependency must specify an absolute path systemPath." for every system scoped dependency on imported POM.xml
Hide
Brett Porter added a comment -

Gabriel, do you have a test project? Like Torben, I can't reproduce using the original example provided.

Show
Brett Porter added a comment - Gabriel, do you have a test project? Like Torben, I can't reproduce using the original example provided.
Hide
Benjamin Bentmann added a comment -

Looks related to MNG-4148. When the parent POM is resolved from the local repo, the profiles from the settings are not applied, thereby leaving jboss.home undefined.

Show
Benjamin Bentmann added a comment - Looks related to MNG-4148. When the parent POM is resolved from the local repo, the profiles from the settings are not applied, thereby leaving jboss.home undefined.

People

Vote (16)
Watch (15)

Dates

  • Created:
    Updated:
    Resolved: