buildnumber-maven-plugin

How to inject SVN revision number into JAR?

我怕爱的太早我们不能终老 提交于 2019-12-09 16:53:25
问题 I want my JAR/WAR application to know what is the SVN revision number of its source code. I want this revision number to be later rendered for web end-users at the bottom of a web page, etc. Is there any existing Maven plugin to automate the process? I think that the plugin has to collect the information from svn and save to some file, like src/resources/revision.txt . 回答1: This page provides the answer to an almost identical problem: Maven CookBook: How To Add SVN Revision To A JAR Manifest?

SVN revision number and timestamp

元气小坏坏 提交于 2019-12-04 09:11:15
I'm trying to display the latest SVN revision number and timestamp on the title bar of a web application. My current code displays the revision number but not timestamp. Both are not coming together. I'm using the following code. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>buildnumber-maven-plugin</artifactId> <version>1.2</version> <executions> <execution> <phase>validate</phase> <goals> <goal>create</goal> </goals> <configuration> <useLastCommittedRevision>true</useLastCommittedRevision> </configuration> </execution> <execution> <id>generate-timestamp</id> <phase>validate<

How to inject SVN revision number into JAR?

爱⌒轻易说出口 提交于 2019-12-04 05:08:47
I want my JAR/WAR application to know what is the SVN revision number of its source code. I want this revision number to be later rendered for web end-users at the bottom of a web page, etc. Is there any existing Maven plugin to automate the process? I think that the plugin has to collect the information from svn and save to some file, like src/resources/revision.txt . This page provides the answer to an almost identical problem: Maven CookBook: How To Add SVN Revision To A JAR Manifest? In your case, instead of building a manifest entry, you need to use the buildNumber variable for resource

Maven Buildnumber plugin - Git

流过昼夜 提交于 2019-12-03 07:01:10
问题 The Maven Buildnumber plugin doesn't appear to work with GIT yet. Is there a workaround for the time being? I recently switched from SVN to GIT and have found it to be an easy transition, but this is the only thing that I don't have working presently. Walter 回答1: Well, there is MOJO-1199 about the buildnumber plugin and GIT support but the patches haven't been applied yet. However, it seems that Antony Stubbs did some work around this and made it available in this git mirror. Have a look at

Maven build number plugin, how to save the build number in a file?

穿精又带淫゛_ 提交于 2019-12-03 04:56:06
问题 I've a Java project using Spring Framework and Git and I wanted to display a build number. I found the Build Number Maven plugin. With Git the build number is a Git hash. I dislike that and I thought a date was much more expressive. I found this excellent blog article explaining how to use build number plugin with a different profile for SVN and Git. Since I just use Git, instead of creating a new profile, I just copied the plugin part in my build tag. When I run "mvn package" it tells me:

Maven Buildnumber plugin - Git

徘徊边缘 提交于 2019-12-02 20:37:29
The Maven Buildnumber plugin doesn't appear to work with GIT yet. Is there a workaround for the time being? I recently switched from SVN to GIT and have found it to be an easy transition, but this is the only thing that I don't have working presently. Walter Pascal Thivent Well, there is MOJO-1199 about the buildnumber plugin and GIT support but the patches haven't been applied yet. However, it seems that Antony Stubbs did some work around this and made it available in this git mirror . Have a look at it. I use this Maven plugin: https://github.com/ktoso/maven-git-commit-id-plugin and have it

Maven build number plugin, how to save the build number in a file?

夙愿已清 提交于 2019-12-02 18:14:35
I've a Java project using Spring Framework and Git and I wanted to display a build number. I found the Build Number Maven plugin . With Git the build number is a Git hash. I dislike that and I thought a date was much more expressive. I found this excellent blog article explaining how to use build number plugin with a different profile for SVN and Git. Since I just use Git, instead of creating a new profile, I just copied the plugin part in my build tag. When I run "mvn package" it tells me: [INFO] --- buildnumber-maven-plugin:1.0:create (default) @ sherd --- [INFO] Storing buildNumber: 2011-08

Hot to disable buildnumber-maven-plugin through cmd

ⅰ亾dé卋堺 提交于 2019-12-01 18:05:44
I have question about maven. How can I disable buildnumber-maven-plugin through command line option. I want to run "mvn test" command on our continuous integration server, but this cmd failed because it trying to build a version and haven't access permission to our vcs (which is configured in tag). So it is possible disable it through cmd option or run only the tests without building new release version? Thanks for any help. Use a profile to control which plug-ins are enabled during the build: <project> <modelVersion>4.0.0</modelVersion> <groupId>com.me.test</groupId> <artifactId>demo<

How to display SVN version in Maven usng the build-number plugin

三世轮回 提交于 2019-12-01 08:02:10
How do display the svn version and the timestamp using build number plugin. Currently I have the following <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>buildnumber-maven-plugin</artifactId> <configuration> <format>At {0,time} on {0,date} : SVN Revision {1,number}</format> <items> <item>timestamp</item> <item>buildNumber</item> </items> <doCheck>false</doCheck> <doUpdate>false</doUpdate> </configuration> </plugin> </plugins> Which shows up as follows: At 8:02:51 AM on Feb 2, 2011 : SVN Revision 1 But my svn revision is 1123. if I comment out the <format> and <items> I get

Can I set the project version with a buildnumber-maven-plugin?

我怕爱的太早我们不能终老 提交于 2019-11-28 20:46:33
I'm trying to add the svn.revision to project version as a build number and can't seem to do so. My jar has the correct name durin packaging, but its installed in the my local repository it is as if ${buildNumber} is/was undefined when the version was set. I get foo-1.0.0-SNAPSHOT- ${buildNumber} instead of foo-1.0.0-SNAPSHOT- 304 Any idea what I'm doing wrong or is adding a revision to the project version a bad idea? Thanks for the help. <project> ... <version>1.0.0-${release.identifier}-${buildNumber}</version> <properties> <release.identifier>SNAPSHOT</release.identifier> </properties> ...