You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2020/04/01 02:41:37 UTC

[maven-studies] branch maven-buildinfo-plugin updated: check corner case: pom.xml should use pom packaging

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

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


The following commit(s) were added to refs/heads/maven-buildinfo-plugin by this push:
     new 09ec905  check corner case: pom.xml should use pom packaging
09ec905 is described below

commit 09ec905846badc785c2bfd1d8c0126b03549a66f
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Wed Apr 1 04:41:32 2020 +0200

    check corner case: pom.xml should use pom packaging
---
 .../java/org/apache/maven/plugins/buildinfo/BuildInfoWriter.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/main/java/org/apache/maven/plugins/buildinfo/BuildInfoWriter.java b/src/main/java/org/apache/maven/plugins/buildinfo/BuildInfoWriter.java
index 5e5e8fc..577a89c 100644
--- a/src/main/java/org/apache/maven/plugins/buildinfo/BuildInfoWriter.java
+++ b/src/main/java/org/apache/maven/plugins/buildinfo/BuildInfoWriter.java
@@ -156,6 +156,13 @@ public class BuildInfoWriter
         throws MojoExecutionException
     {
         prefix = prefix + i;
+        if ( artifact.getFile().isDirectory() )
+        {
+            // edge case found in a distribution module with default packaging and skip set for
+            // m-jar-p: should use pom packaging instead
+            throw new MojoExecutionException( "Artifact " + artifact.getId() + " points to a directory: "
+                + artifact.getFile() + ". Packaging should be 'pom'?" );
+        }
         printFile( prefix, artifact.getFile(), getArtifactFilename( artifact ) );
         artifacts.put( artifact, prefix );
     }