[shrinkwrap-issues] [JBoss JIRA] (SHRINKRES-123) Undefined scopes in depMgt via import scope are promoted to "compile"
Andrew Rubinger (JIRA)
jira-events at lists.jboss.org
Sat Mar 30 06:43:41 EDT 2013
Andrew Rubinger created SHRINKRES-123:
-----------------------------------------
Summary: Undefined scopes in depMgt via import scope are promoted to "compile"
Key: SHRINKRES-123
URL: https://issues.jboss.org/browse/SHRINKRES-123
Project: ShrinkWrap Resolvers
Issue Type: Bug
Reporter: Andrew Rubinger
Assignee: Andrew Rubinger
Priority: Blocker
Assume a BOM POM:
{code}<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">
<!-- Model Version -->
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
<groupId>org.jboss.shrinkwrap.test</groupId>
<artifactId>test-bom-testdeps</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.test</groupId>
<artifactId>test-dependency</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
</build>
</project>{code}
...and a dependency chain POM:
{code}<?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">
<!-- Model Version -->
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
<groupId>org.jboss.shrinkwrap.test</groupId>
<artifactId>test-depchain-testdeps</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.test</groupId>
<artifactId>test-dependency</artifactId>
</dependency>
</dependencies>
<build>
</build>
</project>{code}
Placing a direct dependency upon the depchain POM in "test" scope should limit all transitive dependencies to "test" scope.
{code}<?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">
<!-- Model Version -->
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
<groupId>org.jboss.shrinkwrap.test</groupId>
<artifactId>test-deps-via-bom-and-depchain</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.test</groupId>
<artifactId>test-bom-testdeps</artifactId>
<scope>import</scope>
<type>pom</type>
<version>1.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.test</groupId>
<artifactId>test-depchain-testdeps</artifactId>
<version>1.0.0</version>
<type>pom</type>
<scope>test</scope> <!-- These SHOULD be brought in test scope, but are not in SHRINKRES-123 -->
</dependency>
</dependencies>
</project>{code}
Unfortunately, we currently have no mechanism to denote that a scope in the BOM is intentionally left unspecified, and we incorrectly default this to "compile" in the dependency management section. This leads to leaking when calling upon:
{code}resolver.loadFromPomFile().importRuntimeDependencies();{code}
...which then returns not only the runtime dependencies, but also the test and provided ones as well.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the shrinkwrap-issues
mailing list