[MNG-4890] -pl, -am and -amd options don't consider the version of the artefacts for building the reactor

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1035017 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-11-14 16:17:19 +00:00
parent 5274768c8c
commit 9d24186dda
5 changed files with 254 additions and 0 deletions

View File

@ -85,6 +85,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng4895PluginDepWithNonRelocatedMavenApiTest.class );
suite.addTestSuite( MavenITmng4891RobustSnapshotResolutionTest.class );
suite.addTestSuite( MavenITmng4890MakeLikeReactorConsidersVersionsTest.class );
//suite.addTestSuite( MavenITmng4883FailUponOverconstrainedVersionRangesTest.class );
suite.addTestSuite( MavenITmng4877DeployUsingPrivateKeyTest.class );
suite.addTestSuite( MavenITmng4874UpdateLatestPluginVersionTest.class );

View File

@ -0,0 +1,67 @@
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;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4890">MNG-4890</a>.
*
* @author Benjamin Bentmann
*/
public class MavenITmng4890MakeLikeReactorConsidersVersionsTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng4890MakeLikeReactorConsidersVersionsTest()
{
super( "[3.0,)" );
}
/**
* Verify that the make-like reactor mode considers actual project versions when calculating the inter-module
* dependencies and the modules which need to be build.
*/
public void testit()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4890" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteDirectory( "mod-a/target" );
verifier.deleteDirectory( "mob-b/target" );
verifier.getCliOptions().add( "--projects" );
verifier.getCliOptions().add( "mod-b" );
verifier.getCliOptions().add( "--also-make" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "mod-b/target/touch.txt" );
verifier.assertFileNotPresent( "mod-a/target/touch.txt" );
verifier.assertFileNotPresent( "target/touch.txt" );
}
}

View File

@ -0,0 +1,58 @@
<?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.mng4890</groupId>
<artifactId>mod-a</artifactId>
<!-- NOTE: This isn't the same version that mod-b depends on! -->
<version>0.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4890 :: Module A</name>
<description>
Verify that the make-like reactor mode considers actual project versions when calculating the inter-module
dependencies and the modules which need to be build.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-log-file</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>default</id>
<phase>validate</phase>
<goals>
<goal>reset</goal>
</goals>
<configuration>
<logFile>target/touch.txt</logFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,66 @@
<?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.mng4890</groupId>
<artifactId>mod-b</artifactId>
<version>0.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4890 :: Module B</name>
<description>
Verify that the make-like reactor mode considers actual project versions when calculating the inter-module
dependencies and the modules which need to be build.
</description>
<dependencies>
<dependency>
<!-- NOTE: The reactor contains version 0.2-SNAPSHOT, not the 0.1 we depend on -->
<groupId>org.apache.maven.its.mng4890</groupId>
<artifactId>mod-a</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-log-file</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>default</id>
<phase>validate</phase>
<goals>
<goal>reset</goal>
</goals>
<configuration>
<logFile>target/touch.txt</logFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,62 @@
<?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.mng4890</groupId>
<artifactId>aggregator</artifactId>
<version>0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-4890 :: Aggregator</name>
<description>
Verify that the make-like reactor mode considers actual project versions when calculating the inter-module
dependencies and the modules which need to be build.
</description>
<modules>
<module>mod-a</module> <!-- mod-a:0.2-SNAPSHOT -->
<module>mod-b</module> <!-- depends on mod-a:0.1, not mod-a:0.2-SNAPSHOT, so mod-a isn't a prerequisite for mod-b -->
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-log-file</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>default</id>
<phase>validate</phase>
<goals>
<goal>reset</goal>
</goals>
<configuration>
<logFile>target/touch.txt</logFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>