Issue Details (XML | Word | Printable)

Key: MNG-3666
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Chris Graham
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2

Adding SCOPE in a consolidation POM stops the child dependencies from being resolved

Created: 16/Jul/08 01:22 AM   Updated: 06/Aug/08 07:19 AM
Component/s: Dependencies
Affects Version/s: 2.0.9
Fix Version/s: 2.0.x

Time Tracking:
Not Specified

Environment: WIN XP SP2, JDK 1.5

Complexity: Intermediate


 Description  « Hide
If a consolidated/library pom has a scope in it, it fails to resolve it's child dependencies.

Consider this from a top level pom:

<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>library</artifactId>
<version>V8-FP15</version>
<type>pom</type>
<scope>test</scope>
</dependency>

This is what works:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>library</artifactId>
<version>V8-FP15</version>
<packaging>pom</packaging>
<name>Master POM for the DB2 Universal Drivers from V8 FP15.</name>
<description>POM was created from install:install-file</description>
<dependencies>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc</artifactId>
<version>V8-FP15</version>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc_license_cisuz</artifactId>
<version>V8-FP15</version>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>V8-FP15</version>
</dependency>
</dependencies>
</project>

If I add a scope of <anything> to each dependency, it fails to resolve it's children.

I consider this a bug.

If you are depending on a pom of type pom and the scope attribute is not needed (it should be specified in the top level dependency definition), then it should be ignored. At the very least it should not cease processing it's children.

This is the broken one, for reference:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>library</artifactId>
<version>V8-FP15</version>
<packaging>pom</packaging>
<name>Master POM for the DB2 Universal Drivers from V8 FP15.</name>
<description>POM was created from install:install-file</description>
<dependencies>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc</artifactId>
<version>V8-FP15</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc_license_cisuz</artifactId>
<version>V8-FP15</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>V8-FP15</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>

This all came about from taking all three individual dependencies from a pom and attempting to package them up into a single dependency to make inclusion easier. Drove me nuts for a few days, but I thought that I'd raise it here to save some other poor soul the same pain.

-Chris



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Brett Porter added a comment - 05/Aug/08 11:19 PM
from a cursory look it does seem wrong, the scopes should collect over the tree. I wonder if this is related to the import changes - did it work in earlier versions of Maven?

Chris Graham added a comment - 06/Aug/08 07:19 AM
I'm fairly new to Maven, so all I can say with certainity, is that I saw the issue with 2.0.9. I'm really not sure about previous versions. Should be easy enough to test with though..

-Chris