diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java index 2595e91e73..7c6798ab15 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java @@ -40,41 +40,42 @@ public class MavenITmng2926PluginPrefixOrderTest super( "(2.0.6,)" ); } + /** + * Verify that when resolving plugin prefixes the group org.apache.maven.plugins is searched before + * org.codehaus.mojo and that custom groups from the settings are searched before these standard ones. + */ public void testitMNG2926() throws Exception { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2926" ); Verifier verifier; - //use my custom settings upon invocation. - ArrayList cli = new ArrayList(); - // Install the parent POM, extension and the plugin verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.deleteArtifacts( "org.apache.maven.its.mng2926" ); + verifier.deleteArtifact( "org.apache.maven.plugins", "mng-2926", "0.1", "jar" ); + verifier.deleteArtifact( "org.apache.maven.plugins", "mng-2926", "0.1", "pom" ); + verifier.deleteArtifact( "org.codehaus.mojo", "mng-2926", "0.1", "jar" ); + verifier.deleteArtifact( "org.codehaus.mojo", "mng-2926", "0.1", "pom" ); + verifier.resetStreams(); - verifier.executeGoal( "install" ); + verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.setLogFileName( "log-default.txt" ); + verifier.getCliOptions().add( "--settings" ); + verifier.getCliOptions().add( "settings-default.xml" ); + verifier.executeGoal( "mng-2926:apache" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); - - // 2008-09-29 Oleg: fixed the test. If current settings.xml contains codehause group, - // default order will be changed. Artificially make currently set groups disappear - - // now run the test. Since we have apache and codehaus, i should get the apache one first - testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2926/test-project" ); - cli.add("-s '" +testDir.getAbsolutePath()+"/settings-apache.xml'"); - verifier = new Verifier( testDir.getAbsolutePath() ); - verifier.setCliOptions( cli ); - verifier.executeGoal( "it0119:apache" ); - verifier.verifyErrorFreeLog(); - cli.clear(); -// now run the test. Since we have apache and codehaus and a prefix in my settings, i should get the custom one first - testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2926/test-project" ); verifier = new Verifier( testDir.getAbsolutePath() ); - - cli.add("-s '" +testDir.getAbsolutePath()+"/settings.xml'"); - verifier.setCliOptions( cli ); - verifier.executeGoal( "it0119:custom" ); + verifier.setAutoclean( false ); + verifier.setLogFileName( "log-custom.txt" ); + verifier.getCliOptions().add( "--settings" ); + verifier.getCliOptions().add( "settings-custom.xml" ); + verifier.executeGoal( "mng-2926:custom" ); verifier.verifyErrorFreeLog(); + verifier.resetStreams(); } + } diff --git a/its/core-it-suite/src/test/resources/mng-2926/Readme.txt b/its/core-it-suite/src/test/resources/mng-2926/Readme.txt deleted file mode 100644 index 5307bfc844..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/Readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -This test checks the order of plugin searching. In <2.0.7, Maven searched codehaus before apache. - -This test also verifies that prefixes set by a user in the settings are searched first before the standard ones. - -This is to fix MNG-2926. This test will fail with Maven <=2.0.6. \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-2926/pom.xml b/its/core-it-suite/src/test/resources/mng-2926/pom.xml index 7ee54677ec..3885571229 100644 --- a/its/core-it-suite/src/test/resources/mng-2926/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-2926/pom.xml @@ -1,14 +1,59 @@ + + + 4.0.0 - org.apache.maven.its.it0119 - parent - 1.0 - pom - it0119 - parent - - test-plugin-apache - test-plugin-codehaus - test-plugin-custom - + + org.apache.maven.its.mng2926 + test + 0.1 + + Maven Integration Test :: MNG-2926 + + Verify that when resolving plugin prefixes the group org.apache.maven.plugins is searched before + org.codehaus.mojo and that custom groups from the settings are searched before these standard ones. + + + + + maven-core-it + file:///${basedir}/repo + + ignore + + + false + + + + + + maven-core-it + file:///${basedir}/repo + + ignore + + + false + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/maven-metadata.xml new file mode 100644 index 0000000000..05349f46af --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/maven-metadata.xml @@ -0,0 +1,10 @@ + + + + + Maven Integration Test :: MNG-2926 :: Custom Plugin + mng-2926 + mng-2926 + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/0.1/mng-2926-0.1.jar b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/0.1/mng-2926-0.1.jar new file mode 100644 index 0000000000..e4354c0497 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/0.1/mng-2926-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/0.1/mng-2926-0.1.pom b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/0.1/mng-2926-0.1.pom new file mode 100644 index 0000000000..2737313cc9 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/0.1/mng-2926-0.1.pom @@ -0,0 +1,67 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng2926 + mng-2926 + 0.1 + maven-plugin + + Maven Integration Test :: MNG-2926 :: Custom Plugin + + + + maven-core-it + file:///${basedir}/repo + false + + + + + true + true + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/maven-metadata.xml new file mode 100644 index 0000000000..e831282cac --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/its/mng2926/mng-2926/maven-metadata.xml @@ -0,0 +1,14 @@ + + + org.apache.maven.its.mng2926 + mng-2926 + 0.1 + + 0.1 + 0.1 + + 0.1 + + 20090301212519 + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/maven-metadata.xml new file mode 100644 index 0000000000..44bc333afd --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/maven-metadata.xml @@ -0,0 +1,10 @@ + + + + + Maven Integration Test :: MNG-2926 :: Apache Plugin + mng-2926 + mng-2926 + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/0.1/mng-2926-0.1.jar b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/0.1/mng-2926-0.1.jar new file mode 100644 index 0000000000..4f775ecd3d Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/0.1/mng-2926-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/0.1/mng-2926-0.1.pom b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/0.1/mng-2926-0.1.pom new file mode 100644 index 0000000000..b46d24a07c --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/0.1/mng-2926-0.1.pom @@ -0,0 +1,67 @@ + + + + + + 4.0.0 + + org.apache.maven.plugins + mng-2926 + 0.1 + maven-plugin + + Maven Integration Test :: MNG-2926 :: Apache Plugin + + + + maven-core-it + file:///${basedir}/repo + false + + + + + true + true + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/maven-metadata.xml new file mode 100644 index 0000000000..c95a9c869a --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/apache/maven/plugins/mng-2926/maven-metadata.xml @@ -0,0 +1,14 @@ + + + org.apache.maven.plugins + mng-2926 + 0.1 + + 0.1 + 0.1 + + 0.1 + + 20090301212033 + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/maven-metadata.xml new file mode 100644 index 0000000000..32038deff8 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/maven-metadata.xml @@ -0,0 +1,10 @@ + + + + + Maven Integration Test :: MNG-2926 :: Codehaus Plugin + mng-2926 + mng-2926 + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/0.1/mng-2926-0.1.jar b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/0.1/mng-2926-0.1.jar new file mode 100644 index 0000000000..a67be84d7d Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/0.1/mng-2926-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/0.1/mng-2926-0.1.pom b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/0.1/mng-2926-0.1.pom new file mode 100644 index 0000000000..1701b543a9 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/0.1/mng-2926-0.1.pom @@ -0,0 +1,67 @@ + + + + + + 4.0.0 + + org.codehaus.mojo + mng-2926 + 0.1 + maven-plugin + + Maven Integration Test :: MNG-2926 :: Codehaus Plugin + + + + maven-core-it + file:///${basedir}/repo + false + + + + + true + true + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/maven-metadata.xml new file mode 100644 index 0000000000..b6fb944a7f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/repo/org/codehaus/mojo/mng-2926/maven-metadata.xml @@ -0,0 +1,14 @@ + + + org.codehaus.mojo + mng-2926 + 0.1 + + 0.1 + 0.1 + + 0.1 + + 20090301212348 + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/settings-custom.xml b/its/core-it-suite/src/test/resources/mng-2926/settings-custom.xml new file mode 100644 index 0000000000..21d87ca49a --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/settings-custom.xml @@ -0,0 +1,6 @@ + + + + org.apache.maven.its.mng2926 + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/settings-default.xml b/its/core-it-suite/src/test/resources/mng-2926/settings-default.xml new file mode 100644 index 0000000000..0c79504ce6 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2926/settings-default.xml @@ -0,0 +1,4 @@ + + + + diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/pom.xml b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/pom.xml deleted file mode 100644 index 00eb41a5fd..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - org.apache.maven.plugins - it0119 - maven-plugin - 1.0 - it0119 - Apache plugin - - - org.apache.maven - maven-project - 2.0 - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.maven - maven-artifact - 2.0 - - - - diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/src/main/java/org/apache/maven/plugin/ApacheMojo.java b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/src/main/java/org/apache/maven/plugin/ApacheMojo.java deleted file mode 100644 index c2b2401814..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/src/main/java/org/apache/maven/plugin/ApacheMojo.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.maven.plugin; - -import java.net.URL; - -/** - * @author Brian Fox - * @goal apache - */ -public class ApacheMojo - extends AbstractMojo -{ - - public void execute() - throws MojoExecutionException, MojoFailureException - { - this.getLog().info("Ran Test Apache"); - } - -} diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/src/main/java/org/apache/maven/plugin/IDMojo.java b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/src/main/java/org/apache/maven/plugin/IDMojo.java deleted file mode 100644 index 88610d06c3..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-apache/src/main/java/org/apache/maven/plugin/IDMojo.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.maven.plugin; - -import java.net.URL; - -/** - * @author Brian Fox - * @goal id - */ -public class IDMojo - extends AbstractMojo -{ - - public void execute() - throws MojoExecutionException, MojoFailureException - { - this.getLog().info("Ran Test Apache"); - } - -} diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/pom.xml b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/pom.xml deleted file mode 100644 index feab317b8e..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - org.codehaus.mojo - it0119 - maven-plugin - 1.0 - it0119 - Codehaus plugin - - - org.apache.maven - maven-project - 2.0 - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.maven - maven-artifact - 2.0 - - - - diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/src/main/java/org/apache/maven/plugin/CodehausMojo.java b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/src/main/java/org/apache/maven/plugin/CodehausMojo.java deleted file mode 100644 index c9b1f34789..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/src/main/java/org/apache/maven/plugin/CodehausMojo.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.maven.plugin; - -import java.net.URL; - -/** - * @author Brian Fox - * @goal codehaus - */ -public class CodehausMojo - extends AbstractMojo -{ - - public void execute() - throws MojoExecutionException, MojoFailureException - { - this.getLog().info("Ran Test Codehaus"); - } - -} diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/src/main/java/org/apache/maven/plugin/IDMojo.java b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/src/main/java/org/apache/maven/plugin/IDMojo.java deleted file mode 100644 index bd5a213644..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-codehaus/src/main/java/org/apache/maven/plugin/IDMojo.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.maven.plugin; - -import java.net.URL; - -/** - * @author Brian Fox - * @goal id - */ -public class IDMojo - extends AbstractMojo -{ - - public void execute() - throws MojoExecutionException, MojoFailureException - { - this.getLog().info("Ran Test Codehaus"); - } - -} diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/pom.xml b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/pom.xml deleted file mode 100644 index c48333b76f..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - org.apache.maven.its.mng2926 - it0119 - maven-plugin - 1.0 - it0119 - Custom plugin - - - org.apache.maven - maven-project - 2.0 - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.maven - maven-artifact - 2.0 - - - - diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/src/main/java/org/apache/maven/plugin/CustomMojo.java b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/src/main/java/org/apache/maven/plugin/CustomMojo.java deleted file mode 100644 index 25d45cc228..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/src/main/java/org/apache/maven/plugin/CustomMojo.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.maven.plugin; - -import java.net.URL; - -/** - * @author Brian Fox - * @goal custom - */ -public class CustomMojo - extends AbstractMojo -{ - - public void execute() - throws MojoExecutionException, MojoFailureException - { - this.getLog().info("Ran Test Custom"); - } - -} diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/src/main/java/org/apache/maven/plugin/IDMojo.java b/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/src/main/java/org/apache/maven/plugin/IDMojo.java deleted file mode 100644 index 997e930ef4..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-plugin-custom/src/main/java/org/apache/maven/plugin/IDMojo.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.maven.plugin; - -import java.net.URL; - -/** - * @author Brian Fox - * @goal id - */ -public class IDMojo - extends AbstractMojo -{ - - public void execute() - throws MojoExecutionException, MojoFailureException - { - this.getLog().info("Ran Test Custom"); - } - -} diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-project/pom.xml b/its/core-it-suite/src/test/resources/mng-2926/test-project/pom.xml deleted file mode 100644 index 9725bb7ebe..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-project/pom.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - 4.0.0 - org.apache.maven.its.it0119 - it0119-plugin-runner - 1.0 - pom - it0119 - plugin runner - - - \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-project/settings-apache.xml b/its/core-it-suite/src/test/resources/mng-2926/test-project/settings-apache.xml deleted file mode 100644 index 3ded40edb3..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-project/settings-apache.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-2926/test-project/settings.xml b/its/core-it-suite/src/test/resources/mng-2926/test-project/settings.xml deleted file mode 100644 index 35a166a3eb..0000000000 --- a/its/core-it-suite/src/test/resources/mng-2926/test-project/settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - org.apache.maven.its.mng2926 - - \ No newline at end of file