mirror of https://github.com/apache/maven.git
[MNG-4034] dependency version is not inherited from parent dependencyManagement
o Added UT git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@744254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0abb04c8bb
commit
90e6b3ecb8
|
@ -819,7 +819,7 @@ public class PomConstructionTest
|
|||
}
|
||||
|
||||
/** MNG-4027
|
||||
public void testProjectInjectedDependencies()
|
||||
public void testProfileInjectedDependencies()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "profile-injected-dependencies" );
|
||||
|
@ -831,6 +831,21 @@ public class PomConstructionTest
|
|||
}
|
||||
//*/
|
||||
|
||||
/** MNG-4034
|
||||
public void testManagedProfileDependency()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "managed-profile-dependency/sub" );
|
||||
assertEquals( 1, ( (List<?>) pom.getValue( "dependencies" ) ).size() );
|
||||
assertEquals( "org.apache.maven.its", pom.getValue( "dependencies[1]/groupId" ) );
|
||||
assertEquals( "maven-core-it-support", pom.getValue( "dependencies[1]/artifactId" ) );
|
||||
assertEquals( "1.3", pom.getValue( "dependencies[1]/version" ) );
|
||||
assertEquals( "runtime", pom.getValue( "dependencies[1]/scope" ) );
|
||||
assertEquals( 1, ( (List<?>) pom.getValue( "dependencies[1]/exclusions" ) ).size() );
|
||||
assertEquals( "commons-lang", pom.getValue( "dependencies[1]/exclusions[1]/groupId" ) );
|
||||
}
|
||||
//*/
|
||||
|
||||
private void assertPathWithNormalizedFileSeparators( Object value )
|
||||
{
|
||||
assertEquals( new File( value.toString() ).getPath(), value.toString() );
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<?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.mng4034</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-4034</name>
|
||||
<description>
|
||||
Verify that dependencies defined in profiles are subject to the dependency management of the parent.
|
||||
</description>
|
||||
|
||||
<modules>
|
||||
<module>sub</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its</groupId>
|
||||
<artifactId>maven-core-it-support</artifactId>
|
||||
<version>1.3</version>
|
||||
<scope>runtime</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
|
@ -0,0 +1,55 @@
|
|||
<?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.mng4034</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.maven.its.mng4034</groupId>
|
||||
<artifactId>child</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>Maven Integration Test :: MNG-4034</name>
|
||||
<description>
|
||||
Verify that dependencies defined in profiles are subject to the dependency management of the parent.
|
||||
</description>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>maven-core-it</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its</groupId>
|
||||
<artifactId>maven-core-it-support</artifactId>
|
||||
<!-- version should be injected from dependency management of parent -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
Loading…
Reference in New Issue