Repository: maven-integration-testing
Updated Branches:
  refs/heads/MNG-5935 b994e1dc8 -> 7ed70add9 (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/7ed70add
Tree: 
http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/7ed70add
Diff: 
http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/7ed70add

Branch: refs/heads/MNG-5935
Commit: 7ed70add90b38c04b90044a1a575e291641e6b57
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 23:33:36 2017 +0200

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |  1 +
 ...lLostInTranstiveManagedDependenciesTest.java | 61 ++++++++++++++
 .../pom.xml                                     | 83 ++++++++++++++++++++
 3 files changed, 145 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/7ed70add/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..37105d0 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
@@ -113,6 +113,7 @@ public class IntegrationTestSuite
         suite.addTestSuite( 
MavenITmng6173GetProjectsAndDependencyGraphTest.class );
         suite.addTestSuite( MavenITmng6173GetAllProjectsInReactorTest.class );
         suite.addTestSuite( MavenITmng5958LifecyclePhaseBinaryCompat.class );
+        suite.addTestSuite( 
MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.class );
         suite.addTestSuite( 
MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.class );
         suite.addTestSuite( MavenITmng5889FindBasedir.class );
         suite.addTestSuite( MavenITmng5840ParentVersionRanges.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/7ed70add/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..054a307
--- /dev/null
+++ 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java
@@ -0,0 +1,61 @@
+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 org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * 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.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        List<String> dependencies = verifier.loadLines( 
"target/dependencies.txt", "UTF-8" );
+        assertEquals( 5, dependencies.size() );
+        assertEquals( "com.mysema.querydsl:querydsl-core:jar:3.4.3 
(optional)", dependencies.get( 0 ) );
+        assertEquals( "com.google.guava:guava:jar:17.0 (optional)", 
dependencies.get( 1 ) );
+        assertEquals( "com.google.code.findbugs:jsr305:jar:2.0.3 (optional)", 
dependencies.get( 2 ) );
+        assertEquals( "com.mysema.commons:mysema-commons-lang:jar:0.2.4 
(optional)", dependencies.get( 3 ) );
+        assertEquals( "com.infradna.tool:bridge-method-annotation:jar:1.13 
(optional)", dependencies.get( 4 ) );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/7ed70add/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..6e8426c
--- /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>

Reply via email to