diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index 1345883c00..770b499e2d 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -131,8 +131,10 @@ MavenITmng3645POMSyntaxErrorTest
suite.addTestSuite( MavenITmng3052DepRepoAggregationTest.class );
suite.addTestSuite( MavenITmng3012Test.class );
suite.addTestSuite( MavenITmng2972OverridePluginDependency.class );
+ suite.addTestSuite( MavenITmng2921Test.class );
suite.addTestSuite( MavenITmng2892Test.class );
suite.addTestSuite( MavenITmng2878Test.class );
+ suite.addTestSuite( MavenITmng2871Test.class );
suite.addTestSuite( MavenITmng2861RelocationsAndRanges.class );
suite.addTestSuite( MavenITmng2790Test.class );
suite.addTestSuite( MavenITmng2749Test.class );
@@ -279,9 +281,6 @@ MavenITmng3645POMSyntaxErrorTest
// suite.addTestSuite( MavenITmng3391ImportScopeErrorScenariosTest.class );
// suite.addTestSuite( MavenITmng3530DynamicPOMInterpolationTest.class );
- // -- not passing for 2.0.7 either, looks to be 2.1+ ?
- // suite.addTestSuite( MavenIT0120EjbClientDependency.class );
-
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
// suite.addTestSuite( MavenIT0121TransitiveDepManVersion.class ); -- MNG-3038
// suite.addTestSuite( MavenIT0122ReactorDependencyResolutionTest.class ); -- MNG-3023
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0120EjbClientDependency.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2871Test.java
similarity index 53%
rename from its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0120EjbClientDependency.java
rename to its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2871Test.java
index 1fd00df16a..67016af092 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0120EjbClientDependency.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2871Test.java
@@ -19,29 +19,46 @@ package org.apache.maven.it;
* under the License.
*/
-import java.io.File;
-
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
-public class MavenIT0120EjbClientDependency
+import java.io.File;
+import java.util.List;
+
+/**
+ * This is a test set for MNG-2871.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng2871Test
extends AbstractMavenIntegrationTestCase
{
- public void testit0120()
+
+ public MavenITmng2871Test()
+ {
+ super( "(2.999,)" );
+ }
+
+ /**
+ * Verify that dependencies on not-yet-packaged sub artifacts in build phases prior to package can be satisfied
+ * from a module's output directory, i.e. with the loose class files.
+ */
+ public void testitMNG2871()
throws Exception
{
- File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0120-ejbClientDependency" );
-
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2871" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
- verifier.deleteArtifact( "org.apache.maven.its.it0120", "parent", "1.0-SNAPSHOT", "pom" );
- verifier.deleteArtifact( "org.apache.maven.its.it0120", "client", "1.0-SNAPSHOT", "jar" );
- verifier.deleteArtifact( "org.apache.maven.its.it0120", "model", "1.0-SNAPSHOT", "ejb" );
-
- /* Not "install" or "higher" goal to repeat the bug */
- verifier.executeGoal( "compile" );
-
- verifier.verifyErrorFreeLog();
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "consumer/target" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
verifier.resetStreams();
+ List compileClassPath = verifier.loadLines( "consumer/target/compile.txt", "UTF-8" );
+ assertEquals( 2, compileClassPath.size() );
+ assertEquals( new File( testDir, "ejbs/target/classes" ).getCanonicalFile(),
+ new File( compileClassPath.get( 1 ).toString() ).getCanonicalFile() );
}
+
}
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2921Test.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2921Test.java
new file mode 100644
index 0000000000..2f50657c3a
--- /dev/null
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2921Test.java
@@ -0,0 +1,74 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.Collection;
+
+/**
+ * This is a test set for MNG-2921.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng2921Test
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng2921Test()
+ {
+ super( "(2.0.6,)" );
+ }
+
+ /**
+ * Verify that attached project artifacts can be resolved from the reactor as active project artifacts for
+ * consumption on other module's class paths. Note the subtle difference of this test compared to the closely
+ * related issue MNG-2871: This test is about *attached* artifacts, i.e. dependencies that have already been
+ * packaged. MNG-2871 on the other hand is about dependencies that haven't been packaged yet but merely exist
+ * as loose class files in a module's output directory.
+ */
+ public void testitMNG2921()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2921" );
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "consumer/target" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ Collection compileArtifacts = verifier.loadLines( "consumer/target/compile.txt", "UTF-8" );
+ assertTrue( compileArtifacts.toString(),
+ compileArtifacts.contains( "org.apache.maven.its.mng2921:ejbs:ejb-client:client:1.0-SNAPSHOT" ) );
+ assertFalse( compileArtifacts.toString(),
+ compileArtifacts.contains( "org.apache.maven.its.mng2921:tests:test-jar:tests:1.0-SNAPSHOT" ) );
+
+ Collection testArtifacts = verifier.loadLines( "consumer/target/test.txt", "UTF-8" );
+ assertTrue( testArtifacts.toString(),
+ testArtifacts.contains( "org.apache.maven.its.mng2921:ejbs:ejb-client:client:1.0-SNAPSHOT" ) );
+ assertTrue( testArtifacts.toString(),
+ testArtifacts.contains( "org.apache.maven.its.mng2921:tests:test-jar:tests:1.0-SNAPSHOT" ) );
+ }
+
+}
diff --git a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/client/pom.xml b/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/client/pom.xml
deleted file mode 100644
index badc73bdc2..0000000000
--- a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/client/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.apache.maven.its.it0120
- parent
- 1.0-SNAPSHOT
-
- client
- Client
- jar
-
-
- org.apache.maven.its.it0120
- model
- ejb-client
- 1.0-SNAPSHOT
-
-
-
diff --git a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/client/src/main/java/org/apache/maven/its/it0120/MyClient.java b/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/client/src/main/java/org/apache/maven/its/it0120/MyClient.java
deleted file mode 100644
index f356d89b12..0000000000
--- a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/client/src/main/java/org/apache/maven/its/it0120/MyClient.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.maven.its.it0120;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.its.it0120.Component;
-
-public class MyClient
-{
-
- void func()
- {
- Component testComponent = new Component()
- {
-
- public void func()
- {
- }
- };
- }
-}
diff --git a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/pom.xml b/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/pom.xml
deleted file mode 100644
index 92ea09161a..0000000000
--- a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.apache.maven.its.it0120
- parent
- 1.0-SNAPSHOT
-
- model
- Model
- ejb
-
-
-
- org.apache.maven.plugins
- maven-ejb-plugin
-
- 3.0
-
-
- true
-
-
- true
-
-
-
-
-
diff --git a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/src/main/java/org/apache/maven/its/it0120/Component.java b/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/src/main/java/org/apache/maven/its/it0120/Component.java
deleted file mode 100644
index 8a1b4dbf92..0000000000
--- a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/src/main/java/org/apache/maven/its/it0120/Component.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.maven.its.it0120;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-public interface Component
-{
- void func();
-}
diff --git a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/src/main/resources/META-INF/ejb-jar.xml b/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/src/main/resources/META-INF/ejb-jar.xml
deleted file mode 100644
index 0ff6983a2d..0000000000
--- a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/model/src/main/resources/META-INF/ejb-jar.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
diff --git a/its/core-it-suite/src/test/resources/mng-2871/consumer/pom.xml b/its/core-it-suite/src/test/resources/mng-2871/consumer/pom.xml
new file mode 100644
index 0000000000..d3a3daab3f
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-2871/consumer/pom.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mng2871
+ parent
+ 1.0-SNAPSHOT
+
+
+ consumer
+ jar
+
+ Maven Integration Test :: MNG-2871 :: Dependency Consumer
+
+
+
+ org.apache.maven.its.mng2871
+ ejbs
+ ejb-client
+ 1.0-SNAPSHOT
+ compile
+
+
+
+
+
+
+ org.apache.maven.its.plugins
+ maven-it-plugin-dependency-resolution
+ 2.1-SNAPSHOT
+
+
+ resolve
+ validate
+
+ target/compile.txt
+
+
+ compile
+
+
+
+
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-2871/ejbs/pom.xml b/its/core-it-suite/src/test/resources/mng-2871/ejbs/pom.xml
new file mode 100644
index 0000000000..c563c9fdf6
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-2871/ejbs/pom.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mng2871
+ parent
+ 1.0-SNAPSHOT
+
+
+ ejbs
+ ejb
+
+ Maven Integration Test :: MNG-2871 :: EJB Client JAR Provider
+
+
+
+
+ org.apache.maven.its.plugins
+ maven-it-plugin-artifact
+ 2.1-SNAPSHOT
+
+
+
+ install
+ validate
+
+ target/classes
+
+
+ set
+
+
+
+
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-2871/ejbs/target/classes/test.properties b/its/core-it-suite/src/test/resources/mng-2871/ejbs/target/classes/test.properties
new file mode 100644
index 0000000000..4bcd946bdc
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-2871/ejbs/target/classes/test.properties
@@ -0,0 +1,3 @@
+# NOTE: This build output is a static part of the test and not generated by the actual test run, so apparently
+# shouldn't be cleaned.
+key = value
diff --git a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/pom.xml b/its/core-it-suite/src/test/resources/mng-2871/pom.xml
similarity index 59%
rename from its/core-it-suite/src/test/resources/it0120-ejbClientDependency/pom.xml
rename to its/core-it-suite/src/test/resources/mng-2871/pom.xml
index 5858871273..459be5ed89 100644
--- a/its/core-it-suite/src/test/resources/it0120-ejbClientDependency/pom.xml
+++ b/its/core-it-suite/src/test/resources/mng-2871/pom.xml
@@ -9,7 +9,7 @@ to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
@@ -19,20 +19,23 @@ specific language governing permissions and limitations
under the License.
-->
-
+
4.0.0
- org.apache.maven.its.it0120
+
+ org.apache.maven.its.mng2871
parent
- Parent
- pom
1.0-SNAPSHOT
+ pom
+
+ Maven Integration Test :: MNG-2871 :: Parent
+
+ Verify that dependencies on not-yet-packaged sub artifacts in build phases prior to package can be satisfied
+ from a module's output directory, i.e. with the loose class files.
+
+
- model
- client
+ ejbs
+ consumer
-
- MNG-2921,MNG-2871
-
+
diff --git a/its/core-it-suite/src/test/resources/mng-2921/consumer/pom.xml b/its/core-it-suite/src/test/resources/mng-2921/consumer/pom.xml
new file mode 100644
index 0000000000..6d7ae10ebc
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-2921/consumer/pom.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mng2921
+ parent
+ 1.0-SNAPSHOT
+
+
+ consumer
+ jar
+
+ Maven Integration Test :: MNG-2921 :: Dependency Consumer
+
+
+
+
+ org.apache.maven.its.mng2921
+ ejbs
+ ejb-client
+ 1.0-SNAPSHOT
+ compile
+
+
+ org.apache.maven.its.mng2921
+ tests
+ test-jar
+ 1.0-SNAPSHOT
+ test
+
+
+
+
+
+
+ org.apache.maven.its.plugins
+ maven-it-plugin-dependency-resolution
+ 2.1-SNAPSHOT
+
+
+ resolve
+ validate
+
+ target/compile.txt
+ target/test.txt
+
+
+ compile
+ test
+
+
+
+
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-2921/ejbs/attached.jar b/its/core-it-suite/src/test/resources/mng-2921/ejbs/attached.jar
new file mode 100644
index 0000000000..da9625e101
Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-2921/ejbs/attached.jar differ
diff --git a/its/core-it-suite/src/test/resources/mng-2921/ejbs/main.jar b/its/core-it-suite/src/test/resources/mng-2921/ejbs/main.jar
new file mode 100644
index 0000000000..da9625e101
Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-2921/ejbs/main.jar differ
diff --git a/its/core-it-suite/src/test/resources/mng-2921/ejbs/pom.xml b/its/core-it-suite/src/test/resources/mng-2921/ejbs/pom.xml
new file mode 100644
index 0000000000..d26444b470
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-2921/ejbs/pom.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mng2921
+ parent
+ 1.0-SNAPSHOT
+
+
+ ejbs
+ ejb
+
+ Maven Integration Test :: MNG-2921 :: EJB Client JAR Provider
+
+
+
+
+ org.apache.maven.its.plugins
+ maven-it-plugin-artifact
+ 2.1-SNAPSHOT
+
+
+ install
+ validate
+
+ main.jar
+ attached.jar
+ ejb-client
+ client
+
+
+ set
+ attach
+
+
+
+
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-2921/pom.xml b/its/core-it-suite/src/test/resources/mng-2921/pom.xml
new file mode 100644
index 0000000000..c528e63c34
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-2921/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mng2921
+ parent
+ 1.0-SNAPSHOT
+ pom
+
+ Maven Integration Test :: MNG-2921 :: Parent
+
+ Verify that attached project artifacts can be resolved from the reactor as active project artifacts for
+ consumption on other module's class paths. Note the subtle difference of this test compared to the closely
+ related issue MNG-2871: This test is about *attached* artifacts, i.e. dependencies that have already been
+ packaged. MNG-2871 on the other hand is about dependencies that haven't been packaged yet but merely exist
+ as loose class files in a module's output directory.
+
+
+
+ tests
+ ejbs
+ consumer
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-2921/tests/attached.jar b/its/core-it-suite/src/test/resources/mng-2921/tests/attached.jar
new file mode 100644
index 0000000000..da9625e101
Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-2921/tests/attached.jar differ
diff --git a/its/core-it-suite/src/test/resources/mng-2921/tests/main.jar b/its/core-it-suite/src/test/resources/mng-2921/tests/main.jar
new file mode 100644
index 0000000000..da9625e101
Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-2921/tests/main.jar differ
diff --git a/its/core-it-suite/src/test/resources/mng-2921/tests/pom.xml b/its/core-it-suite/src/test/resources/mng-2921/tests/pom.xml
new file mode 100644
index 0000000000..9565c945bd
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-2921/tests/pom.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mng2921
+ parent
+ 1.0-SNAPSHOT
+
+
+ tests
+ jar
+
+ Maven Integration Test :: MNG-2921 :: Test JAR Provider
+
+
+
+
+ org.apache.maven.its.plugins
+ maven-it-plugin-artifact
+ 2.1-SNAPSHOT
+
+
+ install
+ validate
+
+ main.jar
+ attached.jar
+ test-jar
+ tests
+
+
+ set
+ attach
+
+
+
+
+
+
+