git-commit-id-plugin cannot fail build for new projects w.o. .git/ 65/48865/2
authorMichael Vorburger <vorburger@redhat.com>
Thu, 1 Dec 2016 10:41:29 +0000 (11:41 +0100)
committerMichael Vorburger <vorburger@redhat.com>
Thu, 1 Dec 2016 12:04:46 +0000 (13:04 +0100)
Change-Id: I5483524047476b9fcf3562dde55b07c79efbea0b
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
odlparent-lite/pom.xml
odlparent/pom.xml

index 58a69ebd0df60b80294d24fb4e0644e10878c57a..7bd4cc56dadd0aa5d1fc59d82c72d6d396908833 100644 (file)
           </execution>
         </executions>
         <configuration>
+          <failOnNoGitDirectory>false</failOnNoGitDirectory>
           <generateGitPropertiesFile>true</generateGitPropertiesFile>
           <generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/git.properties</generateGitPropertiesFilename>
           <gitDescribe>
index eb35df55832aa7939a9aa8759765db5a896415b5..c8a3927ebf7ab7b7747c9c0c9c65b7474dc310e7 100644 (file)
           <extensions>true</extensions>
           <configuration>
             <instructions>
-              <Include-Resource>{maven-resources},target/classes/LICENSE,META-INF/git.properties=target/classes/META-INF/git.properties</Include-Resource>
+              <!-- Note the '-' for git.properties.. this is required because git-commit-id-plugin has <failOnNoGitDirectory>false,
+                   so that the build doesn't fail if there is no .../.git/ - so git.properties is effectively optional;
+                   and so the '-' there is needed to make the maven-bundle-plugin if that resource is not present.  -->
+              <Include-Resource>{maven-resources},target/classes/LICENSE,META-INF/git.properties=-target/classes/META-INF/git.properties</Include-Resource>
             </instructions>
           </configuration>
         </plugin>