diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java
index bb39003c61..83c2792d44 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java
@@ -19,15 +19,13 @@
package org.apache.maven.it;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.it.AbstractMavenIntegrationTestCase;
-import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+
/**
* This is a test set for MNG-2720.
*
@@ -54,18 +52,34 @@ public class MavenITmng2720SiblingClasspathArtifactsTest
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2720" );
- File pluginDir = new File( testDir, "plugin" );
- File projectDir = new File( testDir, "project-hierarchy" );
- // First, install the plugin used for the test.
- Verifier verifier = new Verifier( pluginDir.getAbsolutePath() );
- verifier.executeGoal( "install" );
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+
+ verifier.executeGoal( "package" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
- // Now, build the project hierarchy that uses the plugin to verify sibling dependencies.
- verifier = new Verifier( projectDir.getAbsolutePath() );
- verifier.executeGoal( "package" );
- verifier.verifyErrorFreeLog();
+ List compileClassPath = verifier.loadLines( "child2/target/compile.classpath", "UTF-8" );
+ assertTrue( find( "child1-1.jar", compileClassPath ) );
+
+ compileClassPath = verifier.loadLines( "child3/target/compile.classpath", "UTF-8" );
+ assertFalse( find( "child1-1.jar", compileClassPath ) );
+ assertTrue( find( "child1-1-tests.jar", compileClassPath ) );
+
+ }
+
+ private boolean find( String pathSubstr, List classPath )
+ {
+ for ( Iterator it = classPath.iterator(); it.hasNext(); )
+ {
+ String path = (String) it.next();
+
+ if ( path.indexOf( pathSubstr ) > -1 )
+ {
+ return true;
+ }
+ }
+
+ return false;
}
}
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child1/pom.xml b/its/core-it-suite/src/test/resources/mng-2720/child1/pom.xml
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child1/pom.xml
rename to its/core-it-suite/src/test/resources/mng-2720/child1/pom.xml
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child1/src/main/java/org/apache/maven/debug/mng2720/App.java b/its/core-it-suite/src/test/resources/mng-2720/child1/src/main/java/org/apache/maven/debug/mng2720/App.java
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child1/src/main/java/org/apache/maven/debug/mng2720/App.java
rename to its/core-it-suite/src/test/resources/mng-2720/child1/src/main/java/org/apache/maven/debug/mng2720/App.java
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child1/src/test/java/org/apache/maven/debug/mng2720/AppTest.java b/its/core-it-suite/src/test/resources/mng-2720/child1/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child1/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
rename to its/core-it-suite/src/test/resources/mng-2720/child1/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child2/pom.xml b/its/core-it-suite/src/test/resources/mng-2720/child2/pom.xml
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child2/pom.xml
rename to its/core-it-suite/src/test/resources/mng-2720/child2/pom.xml
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child2/src/main/java/org/apache/maven/debug/mng2720/App.java b/its/core-it-suite/src/test/resources/mng-2720/child2/src/main/java/org/apache/maven/debug/mng2720/App.java
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child2/src/main/java/org/apache/maven/debug/mng2720/App.java
rename to its/core-it-suite/src/test/resources/mng-2720/child2/src/main/java/org/apache/maven/debug/mng2720/App.java
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child2/src/test/java/org/apache/maven/debug/mng2720/AppTest.java b/its/core-it-suite/src/test/resources/mng-2720/child2/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child2/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
rename to its/core-it-suite/src/test/resources/mng-2720/child2/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child3/pom.xml b/its/core-it-suite/src/test/resources/mng-2720/child3/pom.xml
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child3/pom.xml
rename to its/core-it-suite/src/test/resources/mng-2720/child3/pom.xml
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child3/src/main/java/org/apache/maven/debug/mng2720/App.java b/its/core-it-suite/src/test/resources/mng-2720/child3/src/main/java/org/apache/maven/debug/mng2720/App.java
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child3/src/main/java/org/apache/maven/debug/mng2720/App.java
rename to its/core-it-suite/src/test/resources/mng-2720/child3/src/main/java/org/apache/maven/debug/mng2720/App.java
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child3/src/test/java/org/apache/maven/debug/mng2720/AppTest.java b/its/core-it-suite/src/test/resources/mng-2720/child3/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
similarity index 100%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/child3/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
rename to its/core-it-suite/src/test/resources/mng-2720/child3/src/test/java/org/apache/maven/debug/mng2720/AppTest.java
diff --git a/its/core-it-suite/src/test/resources/mng-2720/plugin/pom.xml b/its/core-it-suite/src/test/resources/mng-2720/plugin/pom.xml
deleted file mode 100644
index f907098121..0000000000
--- a/its/core-it-suite/src/test/resources/mng-2720/plugin/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
- 4.0.0
- org.apache.maven.its.mng2720
- maven-mng2720-plugin
- maven-plugin
- 1
-
-
-
- org.apache.maven
- maven-plugin-api
- 2.0.9
-
-
- org.apache.maven
- maven-project
- 2.0.9
-
-
-
diff --git a/its/core-it-suite/src/test/resources/mng-2720/plugin/src/main/java/org/apache/maven/debug/mng2720/ClasspathMojo.java b/its/core-it-suite/src/test/resources/mng-2720/plugin/src/main/java/org/apache/maven/debug/mng2720/ClasspathMojo.java
deleted file mode 100644
index 5227d45c23..0000000000
--- a/its/core-it-suite/src/test/resources/mng-2720/plugin/src/main/java/org/apache/maven/debug/mng2720/ClasspathMojo.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.apache.maven.debug.mng2720;
-
-import org.apache.maven.artifact.DependencyResolutionRequiredException;
-import org.apache.maven.plugin.Mojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @goal test
- * @requiresDependencyResolution compile
- * @phase package
- */
-public class ClasspathMojo
- implements Mojo
-{
-
- /**
- * @parameter default-value="${project}"
- * @readonly
- */
- private MavenProject project;
-
- /**
- * @parameter default-value="${project.compileClasspathElements}"
- * @readonly
- */
- private List compileClasspathElements;
-
- private Log log;
-
- public void execute() throws MojoExecutionException, MojoFailureException
- {
- if ( "child2".equals( project.getArtifactId() ) )
- {
- boolean found = false;
- for ( Iterator it = compileClasspathElements.iterator(); it.hasNext(); )
- {
- String path = (String) it.next();
- if ( path.indexOf( "child1-1.jar" ) > -1 )
- {
- found = true;
- break;
- }
- }
-
- if ( !found )
- {
- throw new MojoExecutionException( "child1-1.jar dependency artifact path not found in compile classpath for project: " + project.getId() );
- }
- }
- else if ( "child3".equals( project.getArtifactId() ) )
- {
- boolean found = false;
- for ( Iterator it = compileClasspathElements.iterator(); it.hasNext(); )
- {
- String path = (String) it.next();
- if ( path.indexOf( "child1-1-tests.jar" ) > -1 )
- {
- found = true;
- break;
- }
- }
-
- if ( !found )
- {
- throw new MojoExecutionException( "child1-1-tests.jar dependency artifact path not found in compile classpath for project: " + project.getId() );
- }
- }
-
- log.info( "Tests succeeded." );
- }
-
- public Log getLog()
- {
- return log;
- }
-
- public void setLog( Log log )
- {
- this.log = log;
- }
-
-}
diff --git a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/pom.xml b/its/core-it-suite/src/test/resources/mng-2720/pom.xml
similarity index 63%
rename from its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/pom.xml
rename to its/core-it-suite/src/test/resources/mng-2720/pom.xml
index 8cbbcd39c1..f307081e87 100644
--- a/its/core-it-suite/src/test/resources/mng-2720/project-hierarchy/pom.xml
+++ b/its/core-it-suite/src/test/resources/mng-2720/pom.xml
@@ -5,7 +5,7 @@
project-hierarchy
pom
1
- MNG-2720 Project Hierarchy 1
+ MNG-2720 Project Hierarchy
child1
@@ -16,16 +16,19 @@
- org.apache.maven.its.mng2720
- maven-mng2720-plugin
- 1
+ org.apache.maven.its.plugins
+ maven-it-plugin-dependency-resolution
+ 2.1-SNAPSHOT
- test
+ compile-classpath
package
- test
+ compile
+
+ ${project.build.directory}/compile.classpath
+