mirror of
https://github.com/apache/maven.git
synced 2025-02-08 11:05:37 +00:00
[MNG-4418] Dependency resolution appears to misbehave if a remote repository uses the id "local"
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@929328 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b17c2d6917
commit
a158788316
@ -121,6 +121,7 @@ public static Test suite()
|
|||||||
suite.addTestSuite( MavenITmng4423SessionDataFromPluginParameterExpressionTest.class );
|
suite.addTestSuite( MavenITmng4423SessionDataFromPluginParameterExpressionTest.class );
|
||||||
suite.addTestSuite( MavenITmng4422PluginExecutionPhaseInterpolationTest.class );
|
suite.addTestSuite( MavenITmng4422PluginExecutionPhaseInterpolationTest.class );
|
||||||
suite.addTestSuite( MavenITmng4421DeprecatedPomInterpolationExpressionsTest.class );
|
suite.addTestSuite( MavenITmng4421DeprecatedPomInterpolationExpressionsTest.class );
|
||||||
|
suite.addTestSuite( MavenITmng4418ReservedRepoIdLocalTest.class );
|
||||||
suite.addTestSuite( MavenITmng4416PluginOrderAfterProfileInjectionTest.class );
|
suite.addTestSuite( MavenITmng4416PluginOrderAfterProfileInjectionTest.class );
|
||||||
suite.addTestSuite( MavenITmng4415InheritedPluginOrderTest.class );
|
suite.addTestSuite( MavenITmng4415InheritedPluginOrderTest.class );
|
||||||
suite.addTestSuite( MavenITmng4413MirroringOfDependencyRepoTest.class );
|
suite.addTestSuite( MavenITmng4413MirroringOfDependencyRepoTest.class );
|
||||||
|
@ -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-4418">MNG-4418</a>.
|
||||||
|
*
|
||||||
|
* @author Benjamin Bentmann
|
||||||
|
*/
|
||||||
|
public class MavenITmng4418ReservedRepoIdLocalTest
|
||||||
|
extends AbstractMavenIntegrationTestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
public MavenITmng4418ReservedRepoIdLocalTest()
|
||||||
|
{
|
||||||
|
super( "[3.0-alpha-8,)" );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that remote repositories may not use the id "local" which is reserved for the local repository.
|
||||||
|
*/
|
||||||
|
public void testit()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4418" );
|
||||||
|
|
||||||
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
|
verifier.setAutoclean( false );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
fail( "Reserved id 'local' should have caused model validation error." );
|
||||||
|
}
|
||||||
|
catch ( VerificationException e )
|
||||||
|
{
|
||||||
|
verifier.verifyTextInLog( "must not be 'local'" );
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
verifier.resetStreams();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -36,7 +36,8 @@ under the License.
|
|||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>maven-core-it</id>
|
<!-- reserved id (MNG-4418) -->
|
||||||
|
<id>local</id>
|
||||||
<url>file:///${basedir}/repo</url>
|
<url>file:///${basedir}/repo</url>
|
||||||
</repository>
|
</repository>
|
||||||
<!-- remote-only field (MNG-4430) -->
|
<!-- remote-only field (MNG-4430) -->
|
||||||
|
47
its/core-it-suite/src/test/resources/mng-4418/pom.xml
Normal file
47
its/core-it-suite/src/test/resources/mng-4418/pom.xml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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.mng4418</groupId>
|
||||||
|
<artifactId>test</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
|
||||||
|
<name>Maven Integration Test :: MNG-4418</name>
|
||||||
|
<description>
|
||||||
|
Test that remote repositories may not use the id "local" which is reserved for the local repository.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>local</id>
|
||||||
|
<url>http://localhost/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>local</id>
|
||||||
|
<url>http://localhost/</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
</project>
|
Loading…
x
Reference in New Issue
Block a user