[MNG-3813] Plugin class path does not respect ordering of plugin dependencies

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@709722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-11-01 16:15:03 +00:00
parent c509cb8737
commit b173f86b0b
27 changed files with 747 additions and 0 deletions

View File

@ -80,6 +80,7 @@ MavenITmng3415JunkRepositoryMetadataTest
MavenITmng3645POMSyntaxErrorTest
*/
suite.addTestSuite( MavenITmng3813PluginClassPathOrderingTest.class );
suite.addTestSuite( MavenITmng3805ExtensionClassPathOrderingTest.class );
suite.addTestSuite( MavenITmng3796ClassImportInconsistencyTest.class );
suite.addTestSuite( MavenITmng3748BadSettingsXmlTest.class );

View File

@ -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.Properties;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3813">MNG-3813</a>.
*
* @author Benjamin Bentmann
* @version $Id$
*/
public class MavenITmng3813PluginClassPathOrderingTest
extends AbstractMavenIntegrationTestCase
{
/**
* Verify that the ordering of the plugin class path matches the ordering of the dependencies as given in the POM.
*/
public void testitMNG3813()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3813" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng3813" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Properties pclProps = verifier.loadProperties( "target/pcl.properties" );
String className = "org.apache.maven.its.mng3813.SomeClass";
String resName = className.replace( '.', '/' ) + ".class";
assertEquals( "depA", pclProps.getProperty( className + ".methods" ) );
assertTrue( pclProps.getProperty( resName ).endsWith( "/dep-a-0.1.jar!/" + resName ) );
assertEquals( "8", pclProps.getProperty( resName + ".count" ) );
assertTrue( pclProps.getProperty( resName + ".0" ).endsWith( "/dep-a-0.1.jar!/" + resName ) );
assertTrue( pclProps.getProperty( resName + ".1" ).endsWith( "/dep-aa-0.1.jar!/" + resName ) );
assertTrue( pclProps.getProperty( resName + ".2" ).endsWith( "/dep-ac-0.1.jar!/" + resName ) );
assertTrue( pclProps.getProperty( resName + ".3" ).endsWith( "/dep-ab-0.1.jar!/" + resName ) );
assertTrue( pclProps.getProperty( resName + ".4" ).endsWith( "/dep-ad-0.1.jar!/" + resName ) );
assertTrue( pclProps.getProperty( resName + ".5" ).endsWith( "/dep-c-0.1.jar!/" + resName ) );
assertTrue( pclProps.getProperty( resName + ".6" ).endsWith( "/dep-b-0.1.jar!/" + resName ) );
assertTrue( pclProps.getProperty( resName + ".7" ).endsWith( "/dep-d-0.1.jar!/" + resName ) );
}
}

View File

@ -0,0 +1,120 @@
<?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.mng3813</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<name>Maven Integration Test :: MNG-3813</name>
<description>
Verify that the ordering of the plugin class path matches the ordering of the dependencies as given in the POM.
</description>
<repositories>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-class-loader</artifactId>
<version>2.1-SNAPSHOT</version>
<!--
The following dependency section spans this dependency tree:
dep-a
dep-aa
dep-ac
dep-ab
dep-ad
dep-c
dep-b
dep-d
Given this tree, the correct/expected class path is:
dep-a, dep-aa, dep-ac, dep-ab, dep-ad, dep-c, dep-b, dep-d
All of these dependencies contain the same class/resource so we can precisely track their ordering on the
class path by enumerating their resource URLs. The class path is sufficiently long to guard against random
test success.
-->
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-a</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-c</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-b</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-d</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>load</id>
<phase>validate</phase>
<configuration>
<classNames>org.apache.maven.its.mng3813.SomeClass</classNames>
<resourcePaths>org/apache/maven/its/mng3813/SomeClass.class</resourcePaths>
<pluginClassLoaderOutput>target/pcl.properties</pluginClassLoaderOutput>
</configuration>
<goals>
<goal>load</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,79 @@
<?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.mng3813</groupId>
<artifactId>dep-a</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<!-- NOTE: Dependencies are deliberately not in alpha order to detect their accidental sorting. -->
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-aa</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-ac</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-ab</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-ad</artifactId>
<version>0.1</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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-a</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101155009</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,55 @@
<?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.mng3813</groupId>
<artifactId>dep-aa</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-aa</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101154621</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,55 @@
<?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.mng3813</groupId>
<artifactId>dep-ab</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-ab</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101154636</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,55 @@
<?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.mng3813</groupId>
<artifactId>dep-ac</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-ac</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101154653</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,55 @@
<?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.mng3813</groupId>
<artifactId>dep-ad</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-ad</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101154723</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,55 @@
<?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.mng3813</groupId>
<artifactId>dep-b</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-b</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101154515</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,55 @@
<?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.mng3813</groupId>
<artifactId>dep-c</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-c</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101154549</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,55 @@
<?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.mng3813</groupId>
<artifactId>dep-d</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<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,11 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3813</groupId>
<artifactId>dep-d</artifactId>
<version>0.1</version>
<versioning>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081101154605</lastUpdated>
</versioning>
</metadata>