[MNG-3461] Enhance Mirror definition syntax

o Extended IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@733318 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-10 19:24:01 +00:00
parent 6225c5dbbf
commit 96d42cf4d2
7 changed files with 182 additions and 2 deletions

View File

@ -135,4 +135,27 @@ public class MavenITmng3461MirrorMatchingTest
verifier.assertArtifactPresent( "org.apache.maven.its.mng3461", "c", "0.1", "jar" );
}
/**
* Test that mirror definitions are properly evaluated. In particular, the wildcards within a single mirrorOf
* spec should not be greedy.
*/
public void testitNonGreedyWildcard()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3461/test-3" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng3461" );
Properties filterProps = verifier.newDefaultFilterProperties();
verifier.filterFile( "pom.xml", "pom.xml", "UTF-8", filterProps );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertArtifactPresent( "org.apache.maven.its.mng3461", "a", "0.1", "jar" );
}
}

View File

@ -24,9 +24,10 @@ under the License.
<mirror>
<id>test-a</id>
<url>@baseurl@/null0</url>
<mirrorOf>external:*</mirrorOf>
<mirrorOf>*</mirrorOf>
</mirror>
<mirror>
<!-- NOTE: Intended match deliberately not listed first here, ordering in file should not matter for exact match -->
<id>test-b</id>
<url>@baseurl@/repo</url>
<mirrorOf>maven-core-it</mirrorOf>
@ -34,7 +35,7 @@ under the License.
<mirror>
<id>test-c</id>
<url>@baseurl@/null1</url>
<mirrorOf>*</mirrorOf>
<mirrorOf>external:*</mirrorOf>
</mirror>
</mirrors>
</settings>

View File

@ -0,0 +1,74 @@
<?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.mng3461</groupId>
<artifactId>test-3</artifactId>
<version>0.1</version>
<name>Maven Integration Test :: MNG-3461</name>
<description>
Test that mirror definitions are properly evaluated. In particular, the wildcards within a single mirrorOf
spec should not be greedy.
</description>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng3461</groupId>
<artifactId>a</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-dependency-resolution</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>test</id>
<phase>validate</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,36 @@
<?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.mng3461</groupId>
<artifactId>a</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3461</groupId>
<artifactId>a</artifactId>
<version>0.1</version>
<versioning>
<release>0.1</release>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20090109112621</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,34 @@
<?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>
<mirrors>
<mirror>
<id>test-a</id>
<url>http://maven.apache.org/null</url>
<!--
The explicit mismatch with maven-core-it should be dominant over the wildcard, even if the wildcard
is given first.
-->
<mirrorOf>*,!maven-core-it</mirrorOf>
</mirror>
</mirrors>
</settings>