mirror of https://github.com/apache/maven.git
[MNG-1751] merging metadata doesn't fail when timestamp is in the future
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@932404 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f730a6fbf1
commit
6af379ed48
|
@ -454,6 +454,7 @@ public class IntegrationTestSuite
|
|||
suite.addTestSuite( MavenITmng1957JdkActivationWithVersionRangeTest.class );
|
||||
suite.addTestSuite( MavenITmng1908LegacySnapshotUpdateTest.class );
|
||||
suite.addTestSuite( MavenITmng1830ShowVersionTest.class );
|
||||
suite.addTestSuite( MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest.class );
|
||||
suite.addTestSuite( MavenITmng1703PluginMgmtDepInheritanceTest.class );
|
||||
suite.addTestSuite( MavenITmng1701DuplicatePluginTest.class );
|
||||
suite.addTestSuite( MavenITmng1493NonStandardModulePomNamesTest.class );
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
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.FileUtils;
|
||||
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-1751">MNG-1751</a>.
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
public class MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
public MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest()
|
||||
{
|
||||
super( "[3.0-beta-1,)" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that deployment always updates the metadata even if its remote timestamp currently refers to
|
||||
* the future.
|
||||
*/
|
||||
public void testit()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1751" );
|
||||
|
||||
File dir = new File( testDir, "repo/org/apache/maven/its/mng1751/dep/0.1-SNAPSHOT" );
|
||||
FileUtils.copyFile( new File( dir, "template-metadata.xml" ), new File( dir, "maven-metadata.xml" ) );
|
||||
|
||||
// phase 1: deploy a new snapshot, this should update the metadata despite its future timestamp
|
||||
Verifier verifier = new Verifier( new File( testDir, "dep" ).getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng1751" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
// phase 2: resolve snapshot, if the previous deployment didn't update the metadata, we get the wrong file
|
||||
verifier = new Verifier( new File( testDir, "test" ).getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng1751" );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
|
||||
verifier.getCliOptions().add( "--settings" );
|
||||
verifier.getCliOptions().add( "settings.xml" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
Properties checksums = verifier.loadProperties( "target/checksum.properties" );
|
||||
String sha1 = checksums.getProperty( "dep-0.1-SNAPSHOT.jar", "" ).toLowerCase( java.util.Locale.ENGLISH );
|
||||
assertEquals( sha1, 40, sha1.length() );
|
||||
assertFalse( "fc081cd365b837dcb01eb9991f21c409b155ea5c".equals( sha1 ) );
|
||||
}
|
||||
|
||||
}
|
|
@ -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.mng1751</groupId>
|
||||
<artifactId>dep</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-1751 :: Dependency</name>
|
||||
<description>
|
||||
Verify that deployment always updates the metadata even if its remote timestamp currently refers to
|
||||
the future.
|
||||
</description>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>maven-core-it</id>
|
||||
<url>file:///${basedir}/../repo</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-artifact</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<mainFile>pom.xml</mainFile>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>set</goal>
|
||||
<goal>attach-pom</goal>
|
||||
<goal>install</goal>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
Binary file not shown.
|
@ -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.mng1751</groupId>
|
||||
<artifactId>dep</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-1751 :: Dependency</name>
|
||||
<description>
|
||||
Verify that deployment always updates the metadata even if its remote timestamp currently refers to
|
||||
the future.
|
||||
</description>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>maven-core-it</id>
|
||||
<url>file:///${basedir}/../repo</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-artifact</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<mainFile>pom.xml</mainFile>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>set</goal>
|
||||
<goal>attach-pom</goal>
|
||||
<goal>install</goal>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<groupId>org.apache.maven.its.mng1751</groupId>
|
||||
<artifactId>dep</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<versioning>
|
||||
<snapshot>
|
||||
<timestamp>20100409.125524</timestamp>
|
||||
<buildNumber>1</buildNumber>
|
||||
</snapshot>
|
||||
<!-- NOTE: It's the essential piece of this test that this timestamp points at the future -->
|
||||
<lastUpdated>30100409125524</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata xsi:schemaLocation="http://maven.apache.org/METADATA/1.0.0 http://maven.apache.org/xsd/metadata-1.0.0.xsd" xmlns="http://maven.apache.org/METADATA/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<groupId>org.apache.maven.its.mng1751</groupId>
|
||||
<artifactId>dep</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<versioning>
|
||||
<versions>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
</versions>
|
||||
<lastUpdated>20100409125524</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
|
@ -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.mng1751</groupId>
|
||||
<artifactId>test</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-1751</name>
|
||||
<description>
|
||||
Verify that deployment always updates the metadata even if its remote timestamp currently refers to
|
||||
the future.
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.mng1751</groupId>
|
||||
<artifactId>dep</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-dependency-resolution</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<compileClassPathChecksums>target/checksum.properties</compileClassPathChecksums>
|
||||
<significantPathLevels>1</significantPathLevels>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,43 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<settings>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>maven-core-it-repo</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>maven-core-it</id>
|
||||
<url>@baseurl@/../repo</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<checksumPolicy>ignore</checksumPolicy>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
<activeProfiles>
|
||||
<activeProfile>maven-core-it-repo</activeProfile>
|
||||
</activeProfiles>
|
||||
</settings>
|
Loading…
Reference in New Issue