o Decoupled IT from production plugins

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@749127 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-03-01 22:03:52 +00:00
parent 65c8728de9
commit 9166c34310
29 changed files with 361 additions and 249 deletions

View File

@ -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();
}
}

View File

@ -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.

View File

@ -1,14 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.it0119</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it0119 - parent</name>
<modules>
<module>test-plugin-apache</module>
<module>test-plugin-codehaus</module>
<module>test-plugin-custom</module>
</modules>
<groupId>org.apache.maven.its.mng2926</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<name>Maven Integration Test :: MNG-2926</name>
<description>
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.
</description>
<repositories>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<plugins>
<plugin>
<name>Maven Integration Test :: MNG-2926 :: Custom Plugin</name>
<prefix>mng-2926</prefix>
<artifactId>mng-2926</artifactId>
</plugin>
</plugins>
</metadata>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng2926</groupId>
<artifactId>mng-2926</artifactId>
<version>0.1</version>
<packaging>maven-plugin</packaging>
<name>Maven Integration Test :: MNG-2926 :: Custom Plugin</name>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<uniqueVersion>false</uniqueVersion>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
<updateReleaseInfo>true</updateReleaseInfo>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>pom.xml</include>
<include>src/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven.its.mng2926</groupId>
<artifactId>mng-2926</artifactId>
<version>0.1</version>
<versioning>
<latest>0.1</latest>
<release>0.1</release>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20090301212519</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<plugins>
<plugin>
<name>Maven Integration Test :: MNG-2926 :: Apache Plugin</name>
<prefix>mng-2926</prefix>
<artifactId>mng-2926</artifactId>
</plugin>
</plugins>
</metadata>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>mng-2926</artifactId>
<version>0.1</version>
<packaging>maven-plugin</packaging>
<name>Maven Integration Test :: MNG-2926 :: Apache Plugin</name>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<uniqueVersion>false</uniqueVersion>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
<updateReleaseInfo>true</updateReleaseInfo>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>pom.xml</include>
<include>src/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>mng-2926</artifactId>
<version>0.1</version>
<versioning>
<latest>0.1</latest>
<release>0.1</release>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20090301212033</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<plugins>
<plugin>
<name>Maven Integration Test :: MNG-2926 :: Codehaus Plugin</name>
<prefix>mng-2926</prefix>
<artifactId>mng-2926</artifactId>
</plugin>
</plugins>
</metadata>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>mng-2926</artifactId>
<version>0.1</version>
<packaging>maven-plugin</packaging>
<name>Maven Integration Test :: MNG-2926 :: Codehaus Plugin</name>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<uniqueVersion>false</uniqueVersion>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
<updateReleaseInfo>true</updateReleaseInfo>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>pom.xml</include>
<include>src/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.codehaus.mojo</groupId>
<artifactId>mng-2926</artifactId>
<version>0.1</version>
<versioning>
<latest>0.1</latest>
<release>0.1</release>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20090301212348</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<pluginGroups>
<pluginGroup>org.apache.maven.its.mng2926</pluginGroup>
</pluginGroups>
</settings>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- empty to emulate default settings -->
</settings>

View File

@ -1,26 +0,0 @@
<?xml version="1.0"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>it0119</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0</version>
<name>it0119 - Apache plugin</name>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

View File

@ -1,19 +0,0 @@
package org.apache.maven.plugin;
import java.net.URL;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @goal apache
*/
public class ApacheMojo
extends AbstractMojo
{
public void execute()
throws MojoExecutionException, MojoFailureException
{
this.getLog().info("Ran Test Apache");
}
}

View File

@ -1,19 +0,0 @@
package org.apache.maven.plugin;
import java.net.URL;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @goal id
*/
public class IDMojo
extends AbstractMojo
{
public void execute()
throws MojoExecutionException, MojoFailureException
{
this.getLog().info("Ran Test Apache");
}
}

View File

@ -1,26 +0,0 @@
<?xml version="1.0"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>it0119</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0</version>
<name>it0119 - Codehaus plugin</name>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

View File

@ -1,19 +0,0 @@
package org.apache.maven.plugin;
import java.net.URL;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @goal codehaus
*/
public class CodehausMojo
extends AbstractMojo
{
public void execute()
throws MojoExecutionException, MojoFailureException
{
this.getLog().info("Ran Test Codehaus");
}
}

View File

@ -1,19 +0,0 @@
package org.apache.maven.plugin;
import java.net.URL;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @goal id
*/
public class IDMojo
extends AbstractMojo
{
public void execute()
throws MojoExecutionException, MojoFailureException
{
this.getLog().info("Ran Test Codehaus");
}
}

View File

@ -1,26 +0,0 @@
<?xml version="1.0"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng2926</groupId>
<artifactId>it0119</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0</version>
<name>it0119 - Custom plugin</name>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

View File

@ -1,19 +0,0 @@
package org.apache.maven.plugin;
import java.net.URL;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @goal custom
*/
public class CustomMojo
extends AbstractMojo
{
public void execute()
throws MojoExecutionException, MojoFailureException
{
this.getLog().info("Ran Test Custom");
}
}

View File

@ -1,19 +0,0 @@
package org.apache.maven.plugin;
import java.net.URL;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @goal id
*/
public class IDMojo
extends AbstractMojo
{
public void execute()
throws MojoExecutionException, MojoFailureException
{
this.getLog().info("Ran Test Custom");
}
}

View File

@ -1,13 +0,0 @@
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.it0119</groupId>
<artifactId>it0119-plugin-runner</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it0119 - plugin runner</name>
<build>
</build>
</project>

View File

@ -1,2 +0,0 @@
<settings>
</settings>

View File

@ -1,5 +0,0 @@
<settings>
<pluginGroups>
<pluginGroup>org.apache.maven.its.mng2926</pluginGroup>
</pluginGroups>
</settings>