Repository: maven-integration-testing Updated Branches: refs/heads/MNG-5935 b7b324260 -> b994e1dc8 (forced update)
[MNG-5935] Optional true getting lost in managed dependencies when transitive 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/b994e1dc Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/b994e1dc Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/b994e1dc Branch: refs/heads/MNG-5935 Commit: b994e1dc87380d5e93271d299c97b323f8f56fe8 Parents: a985750 Author: Michael Osipov <micha...@apache.org> Authored: Tue May 9 08:19:42 2017 +0200 Committer: Michael Osipov <micha...@apache.org> Committed: Tue May 9 08:24:03 2017 +0200 ---------------------------------------------------------------------- .../apache/maven/it/IntegrationTestSuite.java | 5 +- ...lLostInTranstiveManagedDependenciesTest.java | 63 +++++++++++++++ .../pom.xml | 83 ++++++++++++++++++++ 3 files changed, 149 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b994e1dc/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 0d63f7e..9e3b568 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 @@ -106,7 +106,8 @@ public class IntegrationTestSuite // ------------------------------------------------------------------------------------------------------------- // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 - suite.addTestSuite( MavenITmng6189SiteReportPluginsWarningTest.class ); + suite.addTestSuite( MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.class ); + /*suite.addTestSuite( MavenITmng6189SiteReportPluginsWarningTest.class ); suite.addTestSuite( MavenITmng6057CheckReactorOrderTest.class ); suite.addTestSuite( MavenITmng5895CIFriendlyUsageWithPropertyTest.class ); suite.addTestSuite( MavenITmng6090CIFriendlyTest.class ); @@ -697,7 +698,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenIT0008SimplePluginTest.class ); suite.addTestSuite( MavenITmng6209MultipleBuildExtensions.class ); suite.addTestSuite( MavenITmng6210CoreExtensionsCustomScopesTest.class ); - +*/ /* * Add tests in reverse alpha order above. */ http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b994e1dc/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java new file mode 100644 index 0000000..cdad758 --- /dev/null +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java @@ -0,0 +1,63 @@ +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 java.io.File; +import java.util.List; +import java.util.Properties; +import org.apache.maven.it.util.ResourceExtractor; +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertTrue; + +/** + * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-5935">MNG-5935</a>. + * + */ +public class MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest() + { + super( "[3.5.1,)" ); + } + + public void testitMNG5935() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5935-optional-lost-in-transtive-managed-dependencies" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + /*verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.addCliOption( "--settings" ); + verifier.addCliOption( "settings.xml" );*/ + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + +/* List<String> classpath = verifier.loadLines( "target/classpath.txt", "UTF-8" ); + assertTrue( classpath.toString(), classpath.contains( "direct-0.2.jar" ) ); + assertFalse( classpath.toString(), classpath.contains( "transitive-0.1.jar" ) ); + */ + } + +} http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b994e1dc/core-it-suite/src/test/resources/mng-5935-optional-lost-in-transtive-managed-dependencies/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-5935-optional-lost-in-transtive-managed-dependencies/pom.xml b/core-it-suite/src/test/resources/mng-5935-optional-lost-in-transtive-managed-dependencies/pom.xml new file mode 100644 index 0000000..1a03d3e --- /dev/null +++ b/core-it-suite/src/test/resources/mng-5935-optional-lost-in-transtive-managed-dependencies/pom.xml @@ -0,0 +1,83 @@ +<?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.mng5935</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + + <name>Maven Integration Test :: MNG-5935</name> + <description> + Verify that optional state true does not get lost in managed dependencies when transitive. + </description> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>com.mysema.querydsl</groupId> + <artifactId>querydsl-core</artifactId> + <version>3.4.3</version> + </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>17.0</version> + </dependency> + <dependency> + <groupId>com.google.code.findbugs</groupId> + <artifactId>jsr305</artifactId> + <version>2.0.3</version> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>com.mysema.querydsl</groupId> + <artifactId>querydsl-core</artifactId> + <optional>true</optional> + </dependency> + </dependencies> + + <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/dependencies.txt</compileArtifacts> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project>