You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2022/07/04 16:52:15 UTC

[maven-dependency-tree] branch master updated: [MSHARED-1016] IT tests for transitive provided scope dependencies

This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-tree.git


The following commit(s) were added to refs/heads/master by this push:
     new d0ebc5c  [MSHARED-1016] IT tests for transitive provided scope dependencies
d0ebc5c is described below

commit d0ebc5ce4fcafe26479d04b12e4a46e03e420c33
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Mon Jun 13 23:51:29 2022 +0200

    [MSHARED-1016] IT tests for transitive provided scope dependencies
---
 .../compile-provided-verbose/expected-default.txt  |  2 +
 .../compile-provided-verbose/expected-verbose.txt  |  2 +
 src/it/compile-provided-verbose/invoker.properties | 20 ++++++
 src/it/compile-provided-verbose/pom.xml            | 80 ++++++++++++++++++++++
 src/it/compile-provided-verbose/verify.groovy      | 26 +++++++
 .../runtime-provided-verbose/expected-default.txt  |  2 +
 .../runtime-provided-verbose/expected-verbose.txt  |  2 +
 src/it/runtime-provided-verbose/invoker.properties | 20 ++++++
 src/it/runtime-provided-verbose/pom.xml            | 80 ++++++++++++++++++++++
 src/it/runtime-provided-verbose/verify.groovy      | 26 +++++++
 10 files changed, 260 insertions(+)

diff --git a/src/it/compile-provided-verbose/expected-default.txt b/src/it/compile-provided-verbose/expected-default.txt
new file mode 100644
index 0000000..7af26b1
--- /dev/null
+++ b/src/it/compile-provided-verbose/expected-default.txt
@@ -0,0 +1,2 @@
+org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
+\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:compile
diff --git a/src/it/compile-provided-verbose/expected-verbose.txt b/src/it/compile-provided-verbose/expected-verbose.txt
new file mode 100644
index 0000000..7af26b1
--- /dev/null
+++ b/src/it/compile-provided-verbose/expected-verbose.txt
@@ -0,0 +1,2 @@
+org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
+\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:compile
diff --git a/src/it/compile-provided-verbose/invoker.properties b/src/it/compile-provided-verbose/invoker.properties
new file mode 100644
index 0000000..55442dc
--- /dev/null
+++ b/src/it/compile-provided-verbose/invoker.properties
@@ -0,0 +1,20 @@
+# 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.
+
+invoker.goals = clean validate
+# Maven 2 makes wrong resolution
+invoker.maven.version = 3.0+
diff --git a/src/it/compile-provided-verbose/pom.xml b/src/it/compile-provided-verbose/pom.xml
new file mode 100644
index 0000000..6923653
--- /dev/null
+++ b/src/it/compile-provided-verbose/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 xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.dependency-tree</groupId>
+  <artifactId>verbose</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>VerboseTest</name>
+  <description>
+    Test verbose dependency-tree - artifact with provided dependency in compile scope
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>jakarta.transaction</groupId>
+      <artifactId>jakarta.transaction-api</artifactId>
+      <version>2.0.1</version>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.dependency-tree</groupId>
+        <artifactId>graph-maven-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>verbose</id>
+            <phase>validate</phase>
+            <configuration>
+              <outputFile>target/tree-verbose.txt</outputFile>
+              <verbose>true</verbose>
+            </configuration>
+            <goals>
+              <goal>graph</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>default</id>
+            <phase>validate</phase>
+            <configuration>
+              <outputFile>target/tree-default.txt</outputFile>
+            </configuration>
+            <goals>
+              <goal>graph</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+     </plugins>
+  </build>
+</project>
diff --git a/src/it/compile-provided-verbose/verify.groovy b/src/it/compile-provided-verbose/verify.groovy
new file mode 100644
index 0000000..1736ecd
--- /dev/null
+++ b/src/it/compile-provided-verbose/verify.groovy
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+def actual = new File( basedir, "target/tree-verbose.txt" ).readLines()
+def expected = new File( basedir, "expected-verbose.txt" ).readLines()
+assert actual.equals( expected )
+
+actual = new File( basedir, "target/tree-default.txt" ).readLines()
+expected = new File( basedir, "expected-default.txt" ).readLines()
+assert actual.equals( expected )
diff --git a/src/it/runtime-provided-verbose/expected-default.txt b/src/it/runtime-provided-verbose/expected-default.txt
new file mode 100644
index 0000000..248710b
--- /dev/null
+++ b/src/it/runtime-provided-verbose/expected-default.txt
@@ -0,0 +1,2 @@
+org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
+\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:runtime
diff --git a/src/it/runtime-provided-verbose/expected-verbose.txt b/src/it/runtime-provided-verbose/expected-verbose.txt
new file mode 100644
index 0000000..248710b
--- /dev/null
+++ b/src/it/runtime-provided-verbose/expected-verbose.txt
@@ -0,0 +1,2 @@
+org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
+\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:runtime
diff --git a/src/it/runtime-provided-verbose/invoker.properties b/src/it/runtime-provided-verbose/invoker.properties
new file mode 100644
index 0000000..55442dc
--- /dev/null
+++ b/src/it/runtime-provided-verbose/invoker.properties
@@ -0,0 +1,20 @@
+# 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.
+
+invoker.goals = clean validate
+# Maven 2 makes wrong resolution
+invoker.maven.version = 3.0+
diff --git a/src/it/runtime-provided-verbose/pom.xml b/src/it/runtime-provided-verbose/pom.xml
new file mode 100644
index 0000000..24acc34
--- /dev/null
+++ b/src/it/runtime-provided-verbose/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 xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.dependency-tree</groupId>
+  <artifactId>verbose</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>VerboseTest</name>
+  <description>
+    Test verbose dependency-tree - artifact with provided dependency in runtime scope
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>jakarta.transaction</groupId>
+      <artifactId>jakarta.transaction-api</artifactId>
+      <version>2.0.1</version>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.dependency-tree</groupId>
+        <artifactId>graph-maven-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>verbose</id>
+            <phase>validate</phase>
+            <configuration>
+              <outputFile>target/tree-verbose.txt</outputFile>
+              <verbose>true</verbose>
+            </configuration>
+            <goals>
+              <goal>graph</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>default</id>
+            <phase>validate</phase>
+            <configuration>
+              <outputFile>target/tree-default.txt</outputFile>
+            </configuration>
+            <goals>
+              <goal>graph</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+     </plugins>
+  </build>
+</project>
diff --git a/src/it/runtime-provided-verbose/verify.groovy b/src/it/runtime-provided-verbose/verify.groovy
new file mode 100644
index 0000000..1736ecd
--- /dev/null
+++ b/src/it/runtime-provided-verbose/verify.groovy
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+def actual = new File( basedir, "target/tree-verbose.txt" ).readLines()
+def expected = new File( basedir, "expected-verbose.txt" ).readLines()
+assert actual.equals( expected )
+
+actual = new File( basedir, "target/tree-default.txt" ).readLines()
+expected = new File( basedir, "expected-default.txt" ).readLines()
+assert actual.equals( expected )