mirror of https://github.com/apache/maven.git
[MNG-3133] DefaultModelInheritence::appendPath assumes it is operating on interpolated/literal paths
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@930409 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8928fd7344
commit
ec19fcf37b
|
@ -372,6 +372,7 @@ public class IntegrationTestSuite
|
|||
suite.addTestSuite( MavenITmng3203DefaultLifecycleExecIdTest.class );
|
||||
suite.addTestSuite( MavenITmng3183LoggingToFileTest.class );
|
||||
suite.addTestSuite( MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.class );
|
||||
suite.addTestSuite( MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.class );
|
||||
suite.addTestSuite( MavenITmng3122ActiveProfilesNoDuplicatesTest.class );
|
||||
suite.addTestSuite( MavenITmng3118TestClassPathOrderTest.class );
|
||||
suite.addTestSuite( MavenITmng3106ProfileMultipleActivatorsTest.class );
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
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;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3133">MNG-3133</a>.
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
public class MavenITmng3133UrlNormalizationNotBeforeInterpolationTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
public MavenITmng3133UrlNormalizationNotBeforeInterpolationTest()
|
||||
{
|
||||
super( "[3.0-beta-1,)" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that URL normalization does not happen before interpolation which would result in invalid
|
||||
* inherited URLs for project layouts where the parent resides in a sibling directory of the child
|
||||
* and expressions are used for the parent URLs ("${expression}/../foo" -> "foo").
|
||||
*/
|
||||
public void testit()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3133" );
|
||||
|
||||
Verifier verifier = new Verifier( new File( testDir, "child" ).getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
Properties props = verifier.loadProperties( "target/url.properties" );
|
||||
String url;
|
||||
|
||||
url = props.getProperty( "project.url" );
|
||||
assertEquals( "http://server.org/child", url );
|
||||
url = props.getProperty( "project.scm.url" );
|
||||
assertEquals( "scm:svn:https://svn.org/child", url );
|
||||
url = props.getProperty( "project.scm.connection" );
|
||||
assertEquals( "scm:svn:https://svn.org/child", url );
|
||||
url = props.getProperty( "project.scm.developerConnection" );
|
||||
assertEquals( "scm:svn:https://svn.org/child", url );
|
||||
url = props.getProperty( "project.distributionManagement.site.url" );
|
||||
assertEquals( "dav://server.org/child", url );
|
||||
|
||||
url = props.getProperty( "project.properties.projectUrl" );
|
||||
assertEquals( "http://server.org/child/it", url );
|
||||
url = props.getProperty( "project.properties.projectScmUrl" );
|
||||
assertEquals( "scm:svn:https://svn.org/child/it", url );
|
||||
url = props.getProperty( "project.properties.projectScmConn" );
|
||||
assertEquals( "scm:svn:https://svn.org/child/it", url );
|
||||
url = props.getProperty( "project.properties.projectScmDevConn" );
|
||||
assertEquals( "scm:svn:https://svn.org/child/it", url );
|
||||
url = props.getProperty( "project.properties.projectDistSiteUrl" );
|
||||
assertEquals( "dav://server.org/child/it", url );
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
<?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.mng3133</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.maven.its.mng3133</groupId>
|
||||
<artifactId>child</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
|
||||
<name>Maven Integration Test :: MNG-3133 :: Child</name>
|
||||
<description>
|
||||
Verify that URL normalization does not happen before interpolation which would result in invalid
|
||||
inherited URLs for project layouts where the parent resides in a sibling directory of the child
|
||||
and expressions are used for the parent URLs ("${expression}/../foo" -> "foo").
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<projectUrl>${project.url}/it</projectUrl>
|
||||
<projectScmUrl>${project.scm.url}/it</projectScmUrl>
|
||||
<projectScmConn>${project.scm.connection}/it</projectScmConn>
|
||||
<projectScmDevConn>${project.scm.developerConnection}/it</projectScmDevConn>
|
||||
<projectDistSiteUrl>${project.distributionManagement.site.url}/it</projectDistSiteUrl>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.its.plugins</groupId>
|
||||
<artifactId>maven-it-plugin-expression</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<outputFile>target/url.properties</outputFile>
|
||||
<expressions>
|
||||
<expression>project/properties</expression>
|
||||
<expression>project/url</expression>
|
||||
<expression>project/scm</expression>
|
||||
<expression>project/distributionManagement/site/url</expression>
|
||||
</expressions>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>eval</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,59 @@
|
|||
<?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.mng3133</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-3133</name>
|
||||
<description>
|
||||
Verify that URL normalization does not happen before interpolation which would result in invalid
|
||||
inherited URLs for project layouts where the parent resides in a sibling directory of the child
|
||||
and expressions are used for the parent URLs ("${expression}/../foo" -> "foo").
|
||||
</description>
|
||||
|
||||
<modules>
|
||||
<module>../child</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<webUrl>http://server.org/project</webUrl>
|
||||
<scmUrl>scm:svn:https://svn.org/project</scmUrl>
|
||||
<siteUrl>dav://server.org/project</siteUrl>
|
||||
</properties>
|
||||
|
||||
<url>${webUrl}</url>
|
||||
<scm>
|
||||
<url>${scmUrl}</url>
|
||||
<connection>${scmUrl}</connection>
|
||||
<developerConnection>${scmUrl}</developerConnection>
|
||||
</scm>
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>website</id>
|
||||
<url>${siteUrl}</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
</project>
|
Loading…
Reference in New Issue