Using a previous version of the plugin, if there was no svn on your path, or your project was not checked in yet to subversion, the plugin failed the build due to svn checks. The workaround I had was to add it to a profile that only got executed when .svn file existed and/or the useReleaseProfile property was 'true'.
Now I am relieved to see I don't need to do that anymore.
For one, there is a 'revisionOnScmFailure' property you can set in the configuration that will be used if there is any type of scm exception - a byproduct of which disables further scm communication.
Second you can specify the plugin to use the javasvn scm provider implementation in case there is no 'svn' executable on your PATH. At first pass it might seem unlikely that when dealing with a subversion based project a developer would not have svn on the path, and that is likely true. Consider though that the svn version may be wrong (in which case svn may complain about not being new enough and fail the build) or you are building in a continuous integration env like hudson and you want reproducible use of the same svn tool. In those cases it makes good sense to configure the plugin with "javasvn". See below example:
<plugin>
<groupid>org.codehaus.mojo</groupid>
<artifactid>buildnumber-maven-plugin</artifactid>
<version>1.0-beta-4</version>
<configuration>
<revisiononscmfailure>UNKNOWN_REVISION</revisiononscmfailure>
<providerimplementations>
<svn>javasvn</svn>
</providerimplementations>
</configuration>
<executions>
<execution>
<id>buildnumber-one</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
<execution>
<id>buildnumber-two</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
<configuration>
<format>r${buildNumber} {0,date,yyyy-MM-dd'T'HH:mm:ss.SSSZ}</format>
<items>
<item>timestamp</item>
</items>
</configuration>
</execution>
</executions>
</plugin>
The two executions is so that I can give some context to the ${buildNumber} by prefixing it with 'r' and adding a timestamp formatted along with it.
There are a bunch of other useful properties in this latest release. Thanks to open source.
5 comments:
Thanks mate, this did the trick for me. I didn't know you could do multiple executions of one plugin either so that's a cool trick to know. Cheers.
it is a useful article when i compared to others.thanks for this wonderful article and im really happy to read this.
DevOps certification in Chennai
DevOps Training in Chennai
DevOps course in Chennai
Data science course in chennai
AWS training in chennai
AWS certification in chennai
Awesome post.Really nice blog, i enjoyed your infomations. Thank you and i will expect more in future..keep it up!!
Amazon Web Services Training in Chennai
yurtdışı kargo
resimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
VMXİA
Hello mate grreat blog post
Post a Comment