You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2021/09/29 14:07:06 UTC

[maven-dependency-plugin] branch MDEP-769-tests updated (ffe11e9 -> 0b8f1aa)

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

slachiewicz pushed a change to branch MDEP-769-tests
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git.


 discard ffe11e9  [MDEP-769] tests for verifying changing mojo default parameters
 discard 7c0c440  [MDEP-769] remove final modifier from mojo parameter
 discard 4deb7e7  [MDEP-752] Add ignoredPackagings options for analyze
     add 6a9ada8  Bump mockito-core from 2.28.2 to 3.12.4
     add 2dc1c7a  Adjust CI setup
     add 3ed0f50  Bump maven-dependency-tree from 3.0.1 to 3.1.0
     add 76d5463  [MDEP-769] remove final modifier from mojo parameter
     new 0b8f1aa  [MDEP-769] tests for verifying changing mojo default parameters

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ffe11e9)
            \
             N -- N -- N   refs/heads/MDEP-769-tests (0b8f1aa)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/maven.yml                        | 21 ++------
 pom.xml                                            |  4 +-
 .../ear/pom.xml                                    | 42 ---------------
 .../ejb/pom.xml                                    | 35 ------------
 .../ejb/src/main/java/Main.java                    | 23 --------
 .../invoker.properties                             | 18 -------
 .../pom.xml                                        | 62 ----------------------
 .../verify.groovy                                  | 29 ----------
 .../ear/pom.xml                                    | 42 ---------------
 .../ejb/pom.xml                                    | 35 ------------
 .../ejb/src/main/java/Main.java                    | 23 --------
 .../invoker.properties                             | 18 -------
 .../pom.xml                                        | 44 ---------------
 .../verify.groovy                                  | 28 ----------
 .../dependency/analyze/AbstractAnalyzeMojo.java    | 13 ++---
 .../maven/plugins/dependency/tree/TreeMojo.java    |  2 +-
 16 files changed, 11 insertions(+), 428 deletions(-)
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-custom/ear/pom.xml
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/pom.xml
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/src/main/java/Main.java
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-custom/invoker.properties
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-custom/pom.xml
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-custom/verify.groovy
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ear/pom.xml
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/pom.xml
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/src/main/java/Main.java
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-defaults/invoker.properties
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-defaults/pom.xml
 delete mode 100644 src/it/projects/mdep-752-analyze-ignored-packaging-defaults/verify.groovy

[maven-dependency-plugin] 01/01: [MDEP-769] tests for verifying changing mojo default parameters

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MDEP-769-tests
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit 0b8f1aa603f689333da1fc3b495cd67c8adedcd2
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Tue Sep 14 09:15:56 2021 +0200

    [MDEP-769] tests for verifying changing mojo default parameters
---
 .../invoker.properties                             | 18 +++++++++
 .../pom.xml                                        | 18 ++++++++-
 .../build-classpath-changeparams/test.properties   | 26 +++++++++++++
 .../verify.bsh                                     | 12 +++---
 src/it/projects/build-classpath/pom.xml            | 16 +++++++-
 src/it/projects/build-classpath/verify.bsh         |  2 +
 .../copy-with-prependGroupId/invoker.properties    | 18 +++++++++
 .../pom.xml                                        | 45 ++++++++++++++--------
 .../verify.bsh                                     | 31 ++++++---------
 9 files changed, 141 insertions(+), 45 deletions(-)

diff --git a/src/it/projects/build-classpath-changeparams/invoker.properties b/src/it/projects/build-classpath-changeparams/invoker.properties
new file mode 100644
index 0000000..68eb44c
--- /dev/null
+++ b/src/it/projects/build-classpath-changeparams/invoker.properties
@@ -0,0 +1,18 @@
+# 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 = ${project.groupId}:${project.artifactId}:${project.version}:build-classpath
diff --git a/src/it/projects/build-classpath/pom.xml b/src/it/projects/build-classpath-changeparams/pom.xml
similarity index 78%
copy from src/it/projects/build-classpath/pom.xml
copy to src/it/projects/build-classpath-changeparams/pom.xml
index 5047df0..74963ba 100644
--- a/src/it/projects/build-classpath/pom.xml
+++ b/src/it/projects/build-classpath-changeparams/pom.xml
@@ -24,12 +24,12 @@
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>org.apache.maven.its.dependency</groupId>
-  <artifactId>test</artifactId>
+  <artifactId>build-classpath-changeparams</artifactId>
   <version>1.0-SNAPSHOT</version>
 
   <name>Test</name>
   <description>
-    Test dependency:build-classpath
+    Test dependency:build-classpath with changed default parameters
   </description>
 
   <properties>
@@ -49,6 +49,20 @@
         </exclusion>
       </exclusions>
     </dependency>
+
+    <!-- one dependency with classifier -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0.6</version>
+      <classifier>sources</classifier>
+      <exclusions>
+        <exclusion>
+          <groupId>*</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
   </dependencies>
 
 </project>
diff --git a/src/it/projects/build-classpath-changeparams/test.properties b/src/it/projects/build-classpath-changeparams/test.properties
new file mode 100644
index 0000000..a4f45b9
--- /dev/null
+++ b/src/it/projects/build-classpath-changeparams/test.properties
@@ -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.
+
+mdep.outputFile = target/classpath.txt
+mdep.fileSeparator = /
+mdep.pathSeparator = :
+
+# for test we change default parameters
+mdep.prependGroupId = true
+mdep.stripClassifier = true
+mdep.prefix = PREFIX
+
diff --git a/src/it/projects/build-classpath/verify.bsh b/src/it/projects/build-classpath-changeparams/verify.bsh
similarity index 77%
copy from src/it/projects/build-classpath/verify.bsh
copy to src/it/projects/build-classpath-changeparams/verify.bsh
index 7b3b234..57574e0 100644
--- a/src/it/projects/build-classpath/verify.bsh
+++ b/src/it/projects/build-classpath-changeparams/verify.bsh
@@ -29,11 +29,13 @@ classpath = StringUtils.replace( classpath, "PREFIX/", "" );
 List actual = Arrays.asList( classpath.split( ":" ) );
 
 List expected = new ArrayList();
-expected.add( "maven-profile-2.0.6.jar" );
-expected.add( "maven-model-2.0.6.jar" );
-expected.add( "plexus-utils-1.4.1.jar" );
-expected.add( "plexus-container-default-1.0-alpha-9-stable-1.jar" );
-expected.add( "junit-3.8.1.jar" );
+expected.add( "org.apache.maven.maven-profile-2.0.6.jar" );
+expected.add( "org.apache.maven.maven-model-2.0.6.jar" );
+expected.add( "org.codehaus.plexus.plexus-utils-1.4.1.jar" );
+expected.add( "org.codehaus.plexus.plexus-container-default-1.0-alpha-9-stable-1.jar" );
+expected.add( "junit.junit-3.8.1.jar" );
+// dependency with classifier in pom
+expected.add( "org.apache.maven.maven-project-2.0.6.jar" );
 
 System.out.println( "Checking classpath... " );
 System.out.println( "Actual  : " + actual );
diff --git a/src/it/projects/build-classpath/pom.xml b/src/it/projects/build-classpath/pom.xml
index 5047df0..b89b55d 100644
--- a/src/it/projects/build-classpath/pom.xml
+++ b/src/it/projects/build-classpath/pom.xml
@@ -24,7 +24,7 @@
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>org.apache.maven.its.dependency</groupId>
-  <artifactId>test</artifactId>
+  <artifactId>build-classpath</artifactId>
   <version>1.0-SNAPSHOT</version>
 
   <name>Test</name>
@@ -49,6 +49,20 @@
         </exclusion>
       </exclusions>
     </dependency>
+
+    <!-- one dependency with classifier -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0.6</version>
+      <classifier>sources</classifier>
+      <exclusions>
+        <exclusion>
+          <groupId>*</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
   </dependencies>
 
 </project>
diff --git a/src/it/projects/build-classpath/verify.bsh b/src/it/projects/build-classpath/verify.bsh
index 7b3b234..63990b9 100644
--- a/src/it/projects/build-classpath/verify.bsh
+++ b/src/it/projects/build-classpath/verify.bsh
@@ -34,6 +34,8 @@ expected.add( "maven-model-2.0.6.jar" );
 expected.add( "plexus-utils-1.4.1.jar" );
 expected.add( "plexus-container-default-1.0-alpha-9-stable-1.jar" );
 expected.add( "junit-3.8.1.jar" );
+// dependency with classifier in pom
+expected.add( "maven-project-2.0.6-sources.jar" );
 
 System.out.println( "Checking classpath... " );
 System.out.println( "Actual  : " + actual );
diff --git a/src/it/projects/copy-with-prependGroupId/invoker.properties b/src/it/projects/copy-with-prependGroupId/invoker.properties
new file mode 100644
index 0000000..f50e476
--- /dev/null
+++ b/src/it/projects/copy-with-prependGroupId/invoker.properties
@@ -0,0 +1,18 @@
+# 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 process-sources
diff --git a/src/it/projects/build-classpath/pom.xml b/src/it/projects/copy-with-prependGroupId/pom.xml
similarity index 61%
copy from src/it/projects/build-classpath/pom.xml
copy to src/it/projects/copy-with-prependGroupId/pom.xml
index 5047df0..f0303aa 100644
--- a/src/it/projects/build-classpath/pom.xml
+++ b/src/it/projects/copy-with-prependGroupId/pom.xml
@@ -24,31 +24,42 @@
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>org.apache.maven.its.dependency</groupId>
-  <artifactId>test</artifactId>
+  <artifactId>copy-with-prependGroupId</artifactId>
   <version>1.0-SNAPSHOT</version>
 
   <name>Test</name>
   <description>
-    Test dependency:build-classpath
+    Test dependency:copy with changed default value of prependGroupId
   </description>
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-profile</artifactId>
-      <version>2.0.6</version>
-      <exclusions>
-        <exclusion>
-          <!-- NOTE: Excluded because of questionable handling of dependencyManagement in maven-profile:pom:2.0.6 -->
-          <groupId>classworlds</groupId>
-          <artifactId>classworlds</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-  </dependencies>
-
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <prependGroupId>true</prependGroupId>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.apache.maven</groupId>
+                  <artifactId>maven-model</artifactId>
+                  <version>2.0.6</version>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>
diff --git a/src/it/projects/build-classpath/verify.bsh b/src/it/projects/copy-with-prependGroupId/verify.bsh
similarity index 53%
copy from src/it/projects/build-classpath/verify.bsh
copy to src/it/projects/copy-with-prependGroupId/verify.bsh
index 7b3b234..8018ef2 100644
--- a/src/it/projects/build-classpath/verify.bsh
+++ b/src/it/projects/copy-with-prependGroupId/verify.bsh
@@ -18,30 +18,21 @@
  */
 
 import java.io.*;
-import java.util.*;
 
-import org.codehaus.plexus.util.*;
+File libDir = new File( basedir, "target/dependency" );
 
-String classpath = FileUtils.fileRead( new File( basedir, "target/classpath.txt" ) );
+String[] expectedFiles = {
+    "org.apache.maven.maven-model-2.0.6.jar",
+};
 
-classpath = StringUtils.replace( classpath, "PREFIX/", "" );
-
-List actual = Arrays.asList( classpath.split( ":" ) );
-
-List expected = new ArrayList();
-expected.add( "maven-profile-2.0.6.jar" );
-expected.add( "maven-model-2.0.6.jar" );
-expected.add( "plexus-utils-1.4.1.jar" );
-expected.add( "plexus-container-default-1.0-alpha-9-stable-1.jar" );
-expected.add( "junit-3.8.1.jar" );
-
-System.out.println( "Checking classpath... " );
-System.out.println( "Actual  : " + actual );
-System.out.println( "Expected: " + expected );
-
-if ( !actual.equals( expected ) )
+for ( String expectedFile : expectedFiles )
 {
-    throw new Exception( "Unexpected classpath" );
+    File file = new File( libDir, expectedFile );
+    System.out.println( "Checking for existence of " + file );
+    if ( !file.isFile() )
+    {
+        throw new Exception( "Missing file " + file );
+    }
 }
 
 return true;