mirror of https://github.com/apache/maven.git
gone back to test dependencies not being transitive at all, as reversed in rev1.3 of ProjectClasspathTest. This enables the execution of "m2 test" not to pull in all and sundry test dependencies, eg from wagon. Find a valid use case before re-instating, and look into alternatives for the download issues.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163783 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f3d6a62892
commit
b3b831ec31
|
@ -30,8 +30,8 @@ public class ArtifactConstructionSupport
|
|||
return createArtifact( groupId, artifactId, version, scope, type, null, null );
|
||||
}
|
||||
|
||||
public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String scope, String type,
|
||||
String classifier )
|
||||
public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String scope,
|
||||
String type, String classifier )
|
||||
{
|
||||
return createArtifact( groupId, artifactId, version, scope, type, classifier, null );
|
||||
}
|
||||
|
@ -47,8 +47,9 @@ public class ArtifactConstructionSupport
|
|||
{
|
||||
// TODO: can refactor, use scope handler
|
||||
|
||||
// if this artifact is test, and the dependency is test, don't transitively create
|
||||
if ( Artifact.SCOPE_TEST.equals( inheritedScope ) && Artifact.SCOPE_TEST.equals( scope ) )
|
||||
// re-instate this if test deps are propogated
|
||||
// if ( Artifact.SCOPE_TEST.equals( inheritedScope ) && Artifact.SCOPE_TEST.equals( scope ) )
|
||||
if ( Artifact.SCOPE_TEST.equals( inheritedScope ) )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -66,7 +67,9 @@ public class ArtifactConstructionSupport
|
|||
}
|
||||
// ^^^ added to retain compile scope. Remove if you want compile inherited as runtime
|
||||
|
||||
if ( Artifact.SCOPE_TEST.equals( scope ) || Artifact.SCOPE_TEST.equals( inheritedScope ) )
|
||||
// re-instate this if test deps are propogated
|
||||
// if ( Artifact.SCOPE_TEST.equals( scope ) || Artifact.SCOPE_TEST.equals( inheritedScope ) )
|
||||
if ( Artifact.SCOPE_TEST.equals( scope ) )
|
||||
{
|
||||
desiredScope = Artifact.SCOPE_TEST;
|
||||
}
|
||||
|
|
|
@ -66,11 +66,14 @@ public class ProjectClasspathTest
|
|||
artifact = getArtifact( project, "maven-test-test", "scope-test" );
|
||||
assertNull( "Check no test dependencies are transitive", artifact );
|
||||
artifact = getArtifact( project, "maven-test-test", "scope-compile" );
|
||||
assertEquals( "Check scope", "test", artifact.getScope() );
|
||||
// assertEquals( "Check scope", "test", artifact.getScope() );
|
||||
assertNull( "Check no test dependencies are transitive", artifact );
|
||||
artifact = getArtifact( project, "maven-test-test", "scope-default" );
|
||||
assertEquals( "Check scope", "test", artifact.getScope() );
|
||||
// assertEquals( "Check scope", "test", artifact.getScope() );
|
||||
assertNull( "Check no test dependencies are transitive", artifact );
|
||||
artifact = getArtifact( project, "maven-test-test", "scope-runtime" );
|
||||
assertEquals( "Check scope", "test", artifact.getScope() );
|
||||
// assertEquals( "Check scope", "test", artifact.getScope() );
|
||||
assertNull( "Check no test dependencies are transitive", artifact );
|
||||
|
||||
// check all transitive deps of a runtime dependency are runtime scope, except for test
|
||||
checkGroupIdScope( project, "runtime", "runtime" );
|
||||
|
|
Loading…
Reference in New Issue