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:24:51 UTC

[maven-dependency-plugin] branch master updated (3ed0f50 -> 44fc08c)

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

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


    from 3ed0f50  Bump maven-dependency-tree from 3.0.1 to 3.1.0
     new 6d895a4  [MDEP-769] remove final modifier from mojo parameter
     new 177d39c  [MDEP-769] tests for verifying changing mojo default parameters
     new e438ab4  [MDEP-752] Add ignoredPackagings options for analyze
     new 44fc08c  Update CI setup

The 4 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                        |  2 +-
 .../invoker.properties                             |  0
 .../pom.xml                                        | 18 ++++++-
 .../test.properties                                |  5 ++
 .../verify.bsh                                     | 12 +++--
 src/it/projects/build-classpath/pom.xml            | 16 ++++++-
 src/it/projects/build-classpath/verify.bsh         |  2 +
 .../invoker.properties                             |  0
 .../{copy => copy-with-prependGroupId}/pom.xml     |  5 +-
 .../{copy => copy-with-prependGroupId}/verify.bsh  |  2 +-
 .../ear}/pom.xml                                   |  9 ++--
 .../ejb}/pom.xml                                   |  7 ++-
 .../ejb}/src/main/java/Main.java                   |  1 +
 .../invoker.properties                             |  2 +-
 .../pom.xml                                        | 26 ++++++----
 .../verify.groovy                                  | 56 +++++++++++-----------
 .../ear}/pom.xml                                   |  9 ++--
 .../ejb}/pom.xml                                   |  7 ++-
 .../ejb}/src/main/java/Main.java                   |  1 +
 .../invoker.properties                             |  2 +-
 .../pom.xml                                        | 12 ++---
 .../verify.groovy                                  | 55 ++++++++++-----------
 .../dependency/analyze/AbstractAnalyzeMojo.java    | 19 +++++---
 .../dependency/fromConfiguration/CopyMojo.java     |  2 +-
 .../fromDependencies/BuildClasspathMojo.java       |  4 +-
 25 files changed, 166 insertions(+), 108 deletions(-)
 copy src/it/projects/{build-classpath => build-classpath-changeparams}/invoker.properties (100%)
 copy src/it/projects/{build-classpath => build-classpath-changeparams}/pom.xml (78%)
 copy src/it/projects/{build-classpath => build-classpath-changeparams}/test.properties (90%)
 copy src/it/projects/{build-classpath => build-classpath-changeparams}/verify.bsh (77%)
 copy src/it/projects/{copy => copy-with-prependGroupId}/invoker.properties (100%)
 copy src/it/projects/{copy => copy-with-prependGroupId}/pom.xml (92%)
 copy src/it/projects/{copy => copy-with-prependGroupId}/verify.bsh (96%)
 copy src/it/projects/{analyze-multimodule-project/module2 => mdep-752-analyze-ignored-packaging-custom/ear}/pom.xml (86%)
 copy src/it/projects/{resolve-plugins-exclude-reactor/child-a => mdep-752-analyze-ignored-packaging-custom/ejb}/pom.xml (88%)
 copy src/it/projects/{mdep-714-analyze-ignore-unused-runtime => mdep-752-analyze-ignored-packaging-custom/ejb}/src/main/java/Main.java (99%)
 copy src/it/projects/{copy-cli => mdep-752-analyze-ignored-packaging-custom}/invoker.properties (97%)
 copy src/it/projects/{used-dependencies => mdep-752-analyze-ignored-packaging-custom}/pom.xml (77%)
 copy src/it/projects/{mdep-580_display-manifest-automodules => mdep-752-analyze-ignored-packaging-custom}/verify.groovy (79%)
 copy src/it/projects/{analyze-multimodule-project/module2 => mdep-752-analyze-ignored-packaging-defaults/ear}/pom.xml (86%)
 copy src/it/projects/{resolve-plugins-exclude-reactor/child-a => mdep-752-analyze-ignored-packaging-defaults/ejb}/pom.xml (88%)
 copy src/it/projects/{mdep-714-analyze-ignore-unused-runtime => mdep-752-analyze-ignored-packaging-defaults/ejb}/src/main/java/Main.java (99%)
 copy src/it/projects/{copy-cli => mdep-752-analyze-ignored-packaging-defaults}/invoker.properties (97%)
 copy src/it/projects/{analyze-multimodule-project => mdep-752-analyze-ignored-packaging-defaults}/pom.xml (88%)
 copy src/it/projects/{mdep-580_display-manifest-automodules => mdep-752-analyze-ignored-packaging-defaults}/verify.groovy (83%)

[maven-dependency-plugin] 03/04: [MDEP-752] Add ignoredPackagings options for analyze

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

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

commit e438ab483dde08db4ee7002cd2a3c35a93e6d7ae
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Sun Sep 12 17:09:17 2021 +0200

    [MDEP-752] Add ignoredPackagings options for analyze
    
    By default pom and ear packaging are ignored from analyzing
    
    Closes #165
---
 .../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 +++--
 13 files changed, 409 insertions(+), 3 deletions(-)

diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ear/pom.xml b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ear/pom.xml
new file mode 100644
index 0000000..ea80642
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ear/pom.xml
@@ -0,0 +1,42 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.dependency</groupId>
+    <artifactId>mdep-752-analyze-ignored-packaging-defaults</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>mdep-752-ear</artifactId>
+  <packaging>ear</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.dependency</groupId>
+      <artifactId>mdep-752-ejb</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/pom.xml b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/pom.xml
new file mode 100644
index 0000000..546cbba
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/pom.xml
@@ -0,0 +1,35 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.dependency</groupId>
+    <artifactId>mdep-752-analyze-ignored-packaging-defaults</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>mdep-752-ejb</artifactId>
+  <packaging>ejb</packaging>
+
+</project>
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/src/main/java/Main.java b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/src/main/java/Main.java
new file mode 100644
index 0000000..5e405ff
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/ejb/src/main/java/Main.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+
+public class Main
+{
+}
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-custom/invoker.properties b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/invoker.properties
new file mode 100644
index 0000000..0eca1be
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/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}:analyze
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-custom/pom.xml b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/pom.xml
new file mode 100644
index 0000000..6ef4da9
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/pom.xml
@@ -0,0 +1,62 @@
+<?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</groupId>
+  <artifactId>mdep-752-analyze-ignored-packaging-defaults</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <description>
+    Test dependency:analyze with default ignored packaging
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <modules>
+    <module>ear</module>
+    <module>ejb</module>
+  </modules>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-dependency-plugin</artifactId>
+          <configuration>
+            <failOnWarning>true</failOnWarning>
+            <ignoredPackagings>
+              <ignoredPackaging>pom</ignoredPackaging>
+              <ignoredPackaging>ear</ignoredPackaging>
+              <ignoredPackaging>ejb</ignoredPackaging>
+            </ignoredPackagings>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-custom/verify.groovy b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/verify.groovy
new file mode 100644
index 0000000..fc6fb25
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-custom/verify.groovy
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+File file = new File( basedir, "build.log" );
+assert file.exists();
+
+String buildLog = file.getText( "UTF-8" );
+assert buildLog.contains( 'ignoredPackagings = [pom, ear, ejb]' );
+assert buildLog.contains( '[INFO] Skipping pom project' );
+assert buildLog.contains( '[INFO] Skipping ear project' );
+assert buildLog.contains( '[INFO] Skipping ejb project' );
+
+return true;
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ear/pom.xml b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ear/pom.xml
new file mode 100644
index 0000000..ea80642
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ear/pom.xml
@@ -0,0 +1,42 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.dependency</groupId>
+    <artifactId>mdep-752-analyze-ignored-packaging-defaults</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>mdep-752-ear</artifactId>
+  <packaging>ear</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.dependency</groupId>
+      <artifactId>mdep-752-ejb</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/pom.xml b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/pom.xml
new file mode 100644
index 0000000..546cbba
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/pom.xml
@@ -0,0 +1,35 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.dependency</groupId>
+    <artifactId>mdep-752-analyze-ignored-packaging-defaults</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>mdep-752-ejb</artifactId>
+  <packaging>ejb</packaging>
+
+</project>
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/src/main/java/Main.java b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/src/main/java/Main.java
new file mode 100644
index 0000000..5e405ff
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/ejb/src/main/java/Main.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+
+public class Main
+{
+}
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/invoker.properties b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/invoker.properties
new file mode 100644
index 0000000..0eca1be
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/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}:analyze
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/pom.xml b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/pom.xml
new file mode 100644
index 0000000..c11b388
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/pom.xml
@@ -0,0 +1,44 @@
+<?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</groupId>
+  <artifactId>mdep-752-analyze-ignored-packaging-defaults</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <description>
+    Test dependency:analyze with default ignored packaging
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <modules>
+    <module>ear</module>
+    <module>ejb</module>
+  </modules>
+
+</project>
diff --git a/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/verify.groovy b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/verify.groovy
new file mode 100644
index 0000000..8c8ba1e
--- /dev/null
+++ b/src/it/projects/mdep-752-analyze-ignored-packaging-defaults/verify.groovy
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+File file = new File( basedir, "build.log" );
+assert file.exists();
+
+String buildLog = file.getText( "UTF-8" );
+assert buildLog.contains( 'ignoredPackagings = [pom, ear]' );
+assert buildLog.contains( '[INFO] Skipping pom project' );
+assert buildLog.contains( '[INFO] Skipping ear project' );
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
index d2bb601..d5e36ac 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
@@ -222,6 +222,14 @@ public abstract class AbstractAnalyzeMojo
     @Parameter
     private String[] ignoredUnusedDeclaredDependencies = new String[0];
 
+    /**
+     * List of project packaging that will be ignored.
+     *
+     * @since 3.2.1
+     */
+    @Parameter( defaultValue = "pom,ear" )
+    private List<String> ignoredPackagings = new ArrayList<>();
+
     // Mojo methods -----------------------------------------------------------
 
     /*
@@ -237,9 +245,9 @@ public abstract class AbstractAnalyzeMojo
             return;
         }
 
-        if ( "pom".equals( project.getPackaging() ) )
+        if ( ignoredPackagings.contains( project.getPackaging() ) )
         {
-            getLog().info( "Skipping pom project" );
+            getLog().info( "Skipping " + project.getPackaging() + " project" );
             return;
         }
 
@@ -521,7 +529,6 @@ public abstract class AbstractAnalyzeMojo
     }
 
     private List<Artifact> filterDependencies( Set<Artifact> artifacts, String[] excludes )
-        throws MojoExecutionException
     {
         ArtifactFilter filter = new StrictPatternExcludesArtifactFilter( Arrays.asList( excludes ) );
         List<Artifact> result = new ArrayList<>();

[maven-dependency-plugin] 02/04: [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 master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

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

    [MDEP-769] tests for verifying changing mojo default parameters
    
    Closes #167
---
 .../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;

[maven-dependency-plugin] 04/04: Update CI setup

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

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

commit 44fc08c21134f72b27932d3fdcf6739742f92003
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Wed Sep 29 16:23:57 2021 +0200

    Update CI setup
---
 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 1f53dd1..21f3b26 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -26,7 +26,7 @@ jobs:
       matrix:
         os: [ubuntu-latest,windows-latest, macOS-latest]
         java: [8, 11, 17]
-        jdk: [temurin,zulu]
+        jdk: [temurin]
       fail-fast: false
 
     runs-on: ${{ matrix.os }}

[maven-dependency-plugin] 01/04: [MDEP-769] remove final modifier from mojo parameter

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

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

commit 6d895a4e846d9cdd4afa11a7f570c8013e8e4bb3
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Mon Sep 13 23:44:50 2021 +0200

    [MDEP-769] remove final modifier from mojo parameter
    
    Closes #166
---
 .../maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java       | 6 +++---
 .../apache/maven/plugins/dependency/fromConfiguration/CopyMojo.java | 2 +-
 .../plugins/dependency/fromDependencies/BuildClasspathMojo.java     | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
index 6ab8073..d2bb601 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
@@ -182,7 +182,7 @@ public abstract class AbstractAnalyzeMojo
      * @since 2.10
      */
     @Parameter
-    private final String[] ignoredDependencies = new String[0];
+    private String[] ignoredDependencies = new String[0];
 
     /**
      * List of dependencies that will be ignored if they are used but undeclared. The filter syntax is:
@@ -201,7 +201,7 @@ public abstract class AbstractAnalyzeMojo
      * @since 2.10
      */
     @Parameter
-    private final String[] ignoredUsedUndeclaredDependencies = new String[0];
+    private String[] ignoredUsedUndeclaredDependencies = new String[0];
 
     /**
      * List of dependencies that will be ignored if they are declared but unused. The filter syntax is:
@@ -220,7 +220,7 @@ public abstract class AbstractAnalyzeMojo
      * @since 2.10
      */
     @Parameter
-    private final String[] ignoredUnusedDeclaredDependencies = new String[0];
+    private String[] ignoredUnusedDeclaredDependencies = new String[0];
 
     // Mojo methods -----------------------------------------------------------
 
diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/CopyMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/CopyMojo.java
index bebe5f4..e95d350 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/CopyMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/CopyMojo.java
@@ -59,7 +59,7 @@ public class CopyMojo
      * @since 2.7
      */
     @Parameter( property = "mdep.prependGroupId", defaultValue = "false" )
-    private final boolean prependGroupId = false;
+    private boolean prependGroupId = false;
 
     /**
      * Use artifact baseVersion during copy
diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
index bcb6dac..4a4176a 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
@@ -78,7 +78,7 @@ public class BuildClasspathMojo
      * Strip artifact classifier during copy (only works if prefix is set)
      */
     @Parameter( property = "mdep.stripClassifier", defaultValue = "false" )
-    private final boolean stripClassifier = false;
+    private boolean stripClassifier = false;
 
     /**
      * The prefix to prepend on each dependent artifact. If undefined, the paths refer to the actual files store in the
@@ -158,7 +158,7 @@ public class BuildClasspathMojo
      * @since 2.6
      */
     @Parameter( property = "mdep.useBaseVersion", defaultValue = "true" )
-    private final boolean useBaseVersion = true;
+    private boolean useBaseVersion = true;
 
     /**
      * Maven ProjectHelper