Repository: maven-integration-testing Updated Branches: refs/heads/master 8874003bd -> d889c215a
[MNG-5971] Imported dependencies should be available to inheritance processing o Updated to test inherited ${project.groupId} and ${project.version} expressions are working correctly in dependency management import declarations. Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/d889c215 Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/d889c215 Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/d889c215 Branch: refs/heads/master Commit: d889c215aa88a9e230d0b06b455baa8fde3fb803 Parents: 8874003 Author: Christian Schulte <schu...@apache.org> Authored: Thu Jun 9 10:06:18 2016 +0200 Committer: Christian Schulte <schu...@apache.org> Committed: Thu Jun 9 10:06:18 2016 +0200 ---------------------------------------------------------------------- ...venITmng5971HierarchicalImportScopeTest.java | 35 +++++++++ .../mng-5971/properties/1/2/3/4/pom.xml | 47 ++++++++++++ .../resources/mng-5971/properties/1/2/3/pom.xml | 51 +++++++++++++ .../resources/mng-5971/properties/1/2/pom.xml | 50 ++++++++++++ .../resources/mng-5971/properties/1/pom.xml | 50 ++++++++++++ .../test/resources/mng-5971/properties/pom.xml | 80 ++++++++++++++++++++ 6 files changed, 313 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/d889c215/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java index 6d4df01..31524f3 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5971HierarchicalImportScopeTest.java @@ -118,6 +118,41 @@ public class MavenITmng5971HierarchicalImportScopeTest assertTrue( contains( dependencies, "org.apache.maven.its.mng5971:dependency:jar:3" ) ); } + public void testInheritanceProcessingWithProjectBasedProperties() + throws Exception + { + final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5971/properties" ); + + final Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", + (Map) verifier.newDefaultFilterProperties() ); + + verifier.addCliOption( "-s" ); + verifier.addCliOption( "settings.xml" ); + verifier.executeGoals( Arrays.asList( new String[] + { + "clean", "verify" + } ) ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + final List<String> dependencies0 = verifier.loadLines( "target/compile.txt", "UTF-8" ); + assertTrue( contains( dependencies0, "org.apache.maven.its.mng5971:dependency:jar:0" ) ); + + final List<String> dependencies1 = verifier.loadLines( "1/target/compile.txt", "UTF-8" ); + assertTrue( contains( dependencies1, "org.apache.maven.its.mng5971:dependency:jar:1" ) ); + + final List<String> dependencies2 = verifier.loadLines( "1/2/target/compile.txt", "UTF-8" ); + assertTrue( contains( dependencies2, "org.apache.maven.its.mng5971:dependency:jar:2" ) ); + + final List<String> dependencies3 = verifier.loadLines( "1/2/3/target/compile.txt", "UTF-8" ); + assertTrue( contains( dependencies3, "org.apache.maven.its.mng5971:dependency:jar:3" ) ); + + final List<String> dependencies4 = verifier.loadLines( "1/2/3/4/target/compile.txt", "UTF-8" ); + assertTrue( contains( dependencies4, "org.apache.maven.its.mng5971:dependency:jar:3" ) ); + } + private static boolean contains( final List<String> lines, final String pattern ) { for ( int i = 0, l0 = lines.size(); i < l0; i++ ) http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/d889c215/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/4/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/4/pom.xml b/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/4/pom.xml new file mode 100644 index 0000000..c60f6d0 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/4/pom.xml @@ -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> + + <parent> + <groupId>org.apache.maven.its.mng5971</groupId> + <artifactId>3</artifactId> + <version>3</version> + </parent> + + <artifactId>4</artifactId> + <packaging>pom</packaging> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>import</artifactId> + <!-- Test for version inheritance. --> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/d889c215/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/pom.xml b/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/pom.xml new file mode 100644 index 0000000..501f191 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5971/properties/1/2/3/pom.xml @@ -0,0 +1,51 @@ +<?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.mng5971</groupId> + <artifactId>2</artifactId> + <version>2</version> + </parent> + + <artifactId>3</artifactId> + <version>3</version> + <packaging>pom</packaging> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>import</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <modules> + <module>4</module> + </modules> + +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/d889c215/core-it-suite/src/test/resources/mng-5971/properties/1/2/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5971/properties/1/2/pom.xml b/core-it-suite/src/test/resources/mng-5971/properties/1/2/pom.xml new file mode 100644 index 0000000..5e0b727 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5971/properties/1/2/pom.xml @@ -0,0 +1,50 @@ +<?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.mng5971</groupId> + <artifactId>1</artifactId> + <version>1</version> + </parent> + + <artifactId>2</artifactId> + <version>2</version> + <packaging>pom</packaging> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>import</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <modules> + <module>3</module> + </modules> +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/d889c215/core-it-suite/src/test/resources/mng-5971/properties/1/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5971/properties/1/pom.xml b/core-it-suite/src/test/resources/mng-5971/properties/1/pom.xml new file mode 100644 index 0000000..e374e88 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5971/properties/1/pom.xml @@ -0,0 +1,50 @@ +<?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.mng5971</groupId> + <artifactId>0</artifactId> + <version>0</version> + </parent> + + <artifactId>1</artifactId> + <version>1</version> + <packaging>pom</packaging> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>import</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <modules> + <module>2</module> + </modules> +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/d889c215/core-it-suite/src/test/resources/mng-5971/properties/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5971/properties/pom.xml b/core-it-suite/src/test/resources/mng-5971/properties/pom.xml new file mode 100644 index 0000000..02f870e --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5971/properties/pom.xml @@ -0,0 +1,80 @@ +<?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.mng5971</groupId> + <artifactId>0</artifactId> + <version>0</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-5971</name> + + <description> + Multi module project using dependency management import at each child level testing import are performed on each + level and overriden correctly when using inherited ${project.groupId} and ${project.version} expressions in + dependency management import declarations. + </description> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>dependency</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng5971</groupId> + <artifactId>dependency</artifactId> + </dependency> + </dependencies> + + <modules> + <module>1</module> + </modules> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <compileArtifacts>target/compile.txt</compileArtifacts> + </configuration> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>