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

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


The following commit(s) were added to refs/heads/master by this push:
     new 94e991c  clarify auto-detect skip vs skipModules
94e991c is described below

commit 94e991c34f4287eea6fc03e600da1ae91d6b5488
Author: Hervé Boutemy <hbout...@apache.org>
AuthorDate: Mon Sep 22 00:22:47 2025 +0200

    clarify auto-detect skip vs skipModules
---
 .../artifact/buildinfo/AbstractBuildinfoMojo.java  | 35 ++++++++++++----------
 .../buildinfo/DescribeBuildOutputMojo.java         |  2 +-
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/AbstractBuildinfoMojo.java
 
b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/AbstractBuildinfoMojo.java
index bddfe98..2fbeb6f 100644
--- 
a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/AbstractBuildinfoMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/AbstractBuildinfoMojo.java
@@ -160,8 +160,12 @@ public abstract class AbstractBuildinfoMojo extends 
AbstractMojo {
 
         if (!mono) {
             // if module skips install and/or deploy
-            if (isSkip(project)) {
-                getLog().info("Skipping goal because module skips install 
and/or deploy");
+            if (detectSkip && PluginUtil.isSkip(project)) {
+                getLog().info("Auto-skipping goal because module skips install 
and/or deploy");
+                return;
+            }
+            if (isSkipModule(project)) {
+                getLog().info("Skipping goal for module");
                 return;
             }
             // if multi-module build, generate (aggregate) buildinfo only in 
last module
@@ -384,20 +388,21 @@ public abstract class AbstractBuildinfoMojo extends 
AbstractMojo {
     }
 
     protected boolean isSkip(MavenProject project) {
-        // manual/configured module skip
-        boolean skipModule = false;
-        if (skipModules != null && !skipModules.isEmpty()) {
-            if (skipModulesMatcher == null) {
-                FileSystem fs = FileSystems.getDefault();
-                skipModulesMatcher = skipModules.stream()
-                        .map(i -> fs.getPathMatcher("glob:" + i))
-                        .collect(Collectors.toList());
-            }
-            Path path = Paths.get(project.getGroupId() + '/' + 
project.getArtifactId());
-            skipModule = skipModulesMatcher.stream().anyMatch(m -> 
m.matches(path));
+        return isSkipModule(project) || (detectSkip && 
PluginUtil.isSkip(project));
+    }
+
+    protected boolean isSkipModule(MavenProject project) {
+        if (skipModules == null || skipModules.isEmpty()) {
+            return false;
+        }
+        if (skipModulesMatcher == null) {
+            FileSystem fs = FileSystems.getDefault();
+            skipModulesMatcher = skipModules.stream()
+                    .map(i -> fs.getPathMatcher("glob:" + i))
+                    .collect(Collectors.toList());
         }
-        // detected skip
-        return skipModule || (detectSkip && PluginUtil.isSkip(project));
+        Path path = Paths.get(project.getGroupId() + '/' + 
project.getArtifactId());
+        return skipModulesMatcher.stream().anyMatch(m -> m.matches(path));
     }
 
     private Toolchain getToolchain() {
diff --git 
a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/DescribeBuildOutputMojo.java
 
b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/DescribeBuildOutputMojo.java
index bc316cb..cbb9b91 100644
--- 
a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/DescribeBuildOutputMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/DescribeBuildOutputMojo.java
@@ -122,7 +122,7 @@ public class DescribeBuildOutputMojo extends 
AbstractBuildinfoMojo {
 
         for (MavenProject p : session.getProjects()) {
             boolean skipped = isSkip(p);
-            String s = skipped ? "not-deployed " : "             ";
+            String s = skipped ? (isSkipModule(p) ? "skipped      " : 
"not-deployed ") : "             ";
 
             // project = pom
             // detect Maven 4 consumer POM transient attachment

Reply via email to