You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/01/24 18:46:39 UTC

svn commit: r737403 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-3885/ resources/mng-3885/sub/

Author: bentmann
Date: Sat Jan 24 17:46:39 2009
New Revision: 737403

URL: http://svn.apache.org/viewvc?rev=737403&view=rev
Log:
[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

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3885UniqueVersionFromParentProfileTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/pom-template.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/main.jar   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/pom.xml   (with props)
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=737403&r1=737402&r2=737403&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Sat Jan 24 17:46:39 2009
@@ -117,6 +117,7 @@
         suite.addTestSuite( MavenITmng3892ReleaseDeploymentTest.class );
         suite.addTestSuite( MavenITmng3887PluginExecutionOrderTest.class );
         suite.addTestSuite( MavenITmng3886ExecutionGoalsOrderTest.class );
+        suite.addTestSuite( MavenITmng3885UniqueVersionFromParentProfileTest.class );
         suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class );
         suite.addTestSuite( MavenITmng3873MultipleExecutionGoalsTest.class );
         suite.addTestSuite( MavenITmng3866PluginConfigInheritanceTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3885UniqueVersionFromParentProfileTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3885UniqueVersionFromParentProfileTest.java?rev=737403&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3885UniqueVersionFromParentProfileTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3885UniqueVersionFromParentProfileTest.java Sat Jan 24 17:46:39 2009
@@ -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" );
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3885UniqueVersionFromParentProfileTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3885UniqueVersionFromParentProfileTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/pom-template.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/pom-template.xml?rev=737403&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/pom-template.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/pom-template.xml Sat Jan 24 17:46:39 2009
@@ -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>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/pom-template.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/pom-template.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/main.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/main.jar?rev=737403&view=auto
==============================================================================
Binary file - no diff available.

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/main.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/pom.xml?rev=737403&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/pom.xml Sat Jan 24 17:46:39 2009
@@ -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>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3885/sub/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision