Repository: maven-integration-testing Updated Branches: refs/heads/master d58940e5e -> ff75308bb
MNG-5639 a test for resolving import scope POMs in DependencyManagement The new feature is allowing the repository URL to contain a property. Signed-off-by: Jason van Zyl <ja...@tesla.io> 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/ff75308b Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/ff75308b Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/ff75308b Branch: refs/heads/master Commit: ff75308bbcbbe6f3a2ef6b75d12042028098ce91 Parents: d58940e Author: Mark Ingram <mark.ing...@trafigura.com> Authored: Wed May 28 17:30:48 2014 +0100 Committer: Jason van Zyl <ja...@tesla.io> Committed: Tue Jun 10 12:56:50 2014 -0400 ---------------------------------------------------------------------- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...enITmng5639ImportScopePomResolutionTest.java | 64 +++++++++++++++++++ .../pom.xml | 60 +++++++++++++++++ .../apache/maven/its/mng5639/a/0.1/a-0.1.pom | 46 +++++++++++++ .../apache/maven/its/mng5639/b/0.1/b-0.1.jar | Bin 0 -> 1934 bytes .../apache/maven/its/mng5639/b/0.1/b-0.1.pom | 36 +++++++++++ .../settings-template.xml | 43 +++++++++++++ 7 files changed, 250 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ff75308b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index b229581..6e1caf6 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -107,6 +107,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 suite.addTestSuite( MavenITmng5640LifecycleParticipantAfterSessionEnd.class ); + suite.addTestSuite( MavenITmng5639ImportScopePomResolutionTest.class ); suite.addTestSuite( MavenITmng5608ProfileActivationWarningTest.class ); suite.addTestSuite( MavenITmng5591WorkspaceReader.class ); suite.addTestSuite( MavenITmng5581LifecycleMappingDelegate.class ); http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ff75308b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java new file mode 100644 index 0000000..0221f29 --- /dev/null +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java @@ -0,0 +1,64 @@ +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.util.ResourceExtractor; + +import java.io.File; +import java.util.List; +import java.util.Properties; +import java.util.regex.Pattern; + +/** + * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5639">MNG-5639</a>: + * Check that import POM defined in DependencyManagement can be resolved from a parameterised repository + */ +public class MavenITmng5639ImportScopePomResolutionTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng5639ImportScopePomResolutionTest() + { + super( "(3.2.2-SNAPSHOT,)" ); + } + + public void testitMNG5639() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5639-import-scope-pom-resolution" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.deleteArtifacts( "org.apache.maven.its.mng5639" ); + + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.addCliOption( "--settings" ); + verifier.addCliOption( "settings.xml" ); + + verifier.executeGoal( "install" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + verifier.assertArtifactPresent( "org.apache.maven.its.mng5639", "b", "0.1", "jar" ); + + } + + + +} http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ff75308b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/pom.xml b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/pom.xml new file mode 100644 index 0000000..352cfcf --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/pom.xml @@ -0,0 +1,60 @@ +<?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.mng5639</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-5639</name> + <description> + Checks that an import POM in the dependencyManagement section can be successfully + resolved from a repository defining a URL that contains a property. + </description> + + <properties> + <!-- Value corresponds to the folder name in this directory --> + <repository.url.suffix.property>repo-set-by-property</repository.url.suffix.property> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng5639</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng5639</groupId> + <artifactId>b</artifactId> + </dependency> + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ff75308b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/a/0.1/a-0.1.pom ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/a/0.1/a-0.1.pom b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/a/0.1/a-0.1.pom new file mode 100644 index 0000000..286e902 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/a/0.1/a-0.1.pom @@ -0,0 +1,46 @@ +<?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.mng5639</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng5639</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + </dependencyManagement> +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ff75308b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.jar ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.jar b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.jar new file mode 100644 index 0000000..fb66329 Binary files /dev/null and b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.jar differ http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ff75308b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.pom ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.pom b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.pom new file mode 100644 index 0000000..975aa1f --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/repo-set-by-property/org/apache/maven/its/mng5639/b/0.1/b-0.1.pom @@ -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.mng5639</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ff75308b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/settings-template.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/settings-template.xml b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/settings-template.xml new file mode 100644 index 0000000..7a9a996 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5639-import-scope-pom-resolution/settings-template.xml @@ -0,0 +1,43 @@ +<?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> + <profiles> + <profile> + <id>maven-core-it-repo</id> + <repositories> + <repository> + <id>maven-core-it</id> + <url>@baseurl@/${repository.url.suffix.property}</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + </profile> + </profiles> + <activeProfiles> + <activeProfile>maven-core-it-repo</activeProfile> + </activeProfiles> +</settings>