[MNG-3885] Modules of Maven projects are deployed with Timestamp during reactor build when uniqueVersion is set to false in parent profile

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@737403 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-24 17:46:39 +00:00
parent a73d08839f
commit 3259576eed
5 changed files with 258 additions and 0 deletions

View File

@ -117,6 +117,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng3892ReleaseDeploymentTest.class ); suite.addTestSuite( MavenITmng3892ReleaseDeploymentTest.class );
suite.addTestSuite( MavenITmng3887PluginExecutionOrderTest.class ); suite.addTestSuite( MavenITmng3887PluginExecutionOrderTest.class );
suite.addTestSuite( MavenITmng3886ExecutionGoalsOrderTest.class ); suite.addTestSuite( MavenITmng3886ExecutionGoalsOrderTest.class );
suite.addTestSuite( MavenITmng3885UniqueVersionFromParentProfileTest.class );
suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class ); suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class );
suite.addTestSuite( MavenITmng3873MultipleExecutionGoalsTest.class ); suite.addTestSuite( MavenITmng3873MultipleExecutionGoalsTest.class );
suite.addTestSuite( MavenITmng3866PluginConfigInheritanceTest.class ); suite.addTestSuite( MavenITmng3866PluginConfigInheritanceTest.class );

View File

@ -0,0 +1,132 @@
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-3885">MNG-3885</a>.
*
* @author Benjamin Bentmann
* @version $Id$
*/
public class MavenITmng3885UniqueVersionFromParentProfileTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng3885UniqueVersionFromParentProfileTest()
{
super( "(2.0.10,)" );
}
/**
* Test that uniqueVersion=false defined by a parent profile is effective for child modules when building
* from the parent.
*/
public void testitNonUniqueVersionReactor()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3885" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setLogFileName( "log-f.txt" );
verifier.setAutoclean( false );
verifier.deleteDirectory( "repo-f" );
verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "-Pnon-unique-version" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "repo-f/org/apache/maven/its/mng3885/sub/0.2-SNAPSHOT/sub-0.2-SNAPSHOT.jar" );
}
/**
* Test that uniqueVersion=false defined by a parent profile is effective for child modules when building
* the child in isolation.
*/
public void testitNonUniqueVersionStandalone()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3885" );
Verifier verifier = new Verifier( new File( testDir, "sub" ).getAbsolutePath() );
verifier.setLogFileName( "log-f.txt" );
verifier.setAutoclean( false );
verifier.deleteDirectory( "repo-f" );
verifier.filterFile( "../pom-template.xml", "../pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "-Pnon-unique-version" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "repo-f/org/apache/maven/its/mng3885/sub/0.2-SNAPSHOT/sub-0.2-SNAPSHOT.jar" );
}
/**
* Test that uniqueVersion=true defined by a parent profile is effective for child modules when building
* from the parent.
*/
public void testitUniqueVersionReactor()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3885" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setLogFileName( "log-t.txt" );
verifier.setAutoclean( false );
verifier.deleteDirectory( "repo-t" );
verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "-Punique-version" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFileNotPresent( "repo-t/org/apache/maven/its/mng3885/sub/0.2-SNAPSHOT/sub-0.2-SNAPSHOT.jar" );
verifier.assertFilePresent( "repo-t/org/apache/maven/its/mng3885/sub/0.2-SNAPSHOT/sub-0.2-*-1.jar" );
}
/**
* Test that uniqueVersion=true defined by a parent profile is effective for child modules when building
* the child in isolation.
*/
public void testitUniqueVersionStandalone()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3885" );
Verifier verifier = new Verifier( new File( testDir, "sub" ).getAbsolutePath() );
verifier.setLogFileName( "log-t.txt" );
verifier.setAutoclean( false );
verifier.deleteDirectory( "repo-t" );
verifier.filterFile( "../pom-template.xml", "../pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "-Punique-version" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFileNotPresent( "repo-t/org/apache/maven/its/mng3885/sub/0.2-SNAPSHOT/sub-0.2-SNAPSHOT.jar" );
verifier.assertFilePresent( "repo-t/org/apache/maven/its/mng3885/sub/0.2-SNAPSHOT/sub-0.2-*-1.jar" );
}
}

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.mng3885</groupId>
<artifactId>parent</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-3885</name>
<description>
Test that uniqueVersion defined by a parent profile is effective for child modules when building
from the parent.
</description>
<modules>
<module>sub</module>
</modules>
<profiles>
<profile>
<id>non-unique-version</id>
<distributionManagement>
<snapshotRepository>
<id>maven-core-it</id>
<url>@baseurl@/repo-f</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>unique-version</id>
<distributionManagement>
<snapshotRepository>
<id>maven-core-it</id>
<url>@baseurl@/repo-t</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,63 @@
<?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>
<parent>
<groupId>org.apache.maven.its.mng3885</groupId>
<artifactId>parent</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
<artifactId>sub</artifactId>
<version>0.2-SNAPSHOT</version>
<name>Maven Integration Test :: MNG-3885 :: Child</name>
<description>
Test that uniqueVersion defined by a parent profile is effective for child modules when building
from the parent.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-artifact</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<mainFile>main.jar</mainFile>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>validate</phase>
<goals>
<goal>set</goal>
<goal>install</goal>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>