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 2019/12/29 10:21:48 UTC

[maven-studies] branch maven-buildinfo-plugin updated: added a warning on SCM tag for SNAPSHOTs

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 35328a8  added a warning on SCM tag for SNAPSHOTs
35328a8 is described below

commit 35328a804d2fa578892ad57bbf9d9b0ed9647ae2
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sun Dec 29 11:20:26 2019 +0100

    added a warning on SCM tag for SNAPSHOTs
---
 src/it/mono/pom.xml                                            | 7 +++++++
 src/main/java/org/apache/maven/plugins/buildinfo/SaveMojo.java | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/src/it/mono/pom.xml b/src/it/mono/pom.xml
index 7162acc..0784c7b 100644
--- a/src/it/mono/pom.xml
+++ b/src/it/mono/pom.xml
@@ -38,6 +38,13 @@
     <maven>3.0.5</maven>
   </prerequisites>
 
+  <scm>
+    <connection>scm:git:https://gitbox.apache.org/repos/asf/maven-studies.git</connection>
+    <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-studies.git</developerConnection>
+    <url>https://github.com/apache/maven-studies/tree/${project.scm.tag}</url>
+    <tag>maven-buildinfo-plugin</tag>
+  </scm>
+
   <distributionManagement>
     <snapshotRepository>
       <id>local</id>
diff --git a/src/main/java/org/apache/maven/plugins/buildinfo/SaveMojo.java b/src/main/java/org/apache/maven/plugins/buildinfo/SaveMojo.java
index b347064..fab2cd5 100644
--- a/src/main/java/org/apache/maven/plugins/buildinfo/SaveMojo.java
+++ b/src/main/java/org/apache/maven/plugins/buildinfo/SaveMojo.java
@@ -199,6 +199,12 @@ public class SaveMojo
             sourceAvailable = true;
             p.println( "source.scm.uri=" + project.getScm().getConnection() );
             p.println( "source.scm.tag=" + project.getScm().getTag() );
+            if ( project.getArtifact().isSnapshot() )
+            {
+                getLog().warn( "SCM source tag in buildinfo source.scm.tag=" + project.getScm().getTag()
+                    + " does not permit rebuilders reproducible source checkout" );
+                // TODO is it possible to use Scm API to get SCM version?
+            }
         }
         else
         {