Adding SVN revision number in manifest not working (plugin not found?)

208 views
Skip to first unread message

Ruben Gomez

unread,
Mar 6, 2013, 1:48:11 PM3/6/13
to maven-svn-revisi...@googlegroups.com
Hi,

I am trying to use maven-svn-revision-number-plugin to add the revision number in the manifest of my project.

I have this on my project pom:

        <pluginManagement>
<plugins>
<plugin>
<groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
<artifactId>svn-revision-number-maven-plugin</artifactId>
<version>1.13</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<entries>
<entry>
<prefix>svn</prefix>
</entry>
</entries>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<revision>${svn.revision}</revision>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Now I run "mvn clean package" but nothing appears on my manifest file on the revision line:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: rgomez
Build-Jdk: 1.6.0_25
revision: 

The weird thing is that if I run the command with --debug I see no reference to the plugin at all. I attach log file.

Can anybody tell me what is going wrong???

Thanks


log.txt

Ruben Gomez

unread,
Mar 7, 2013, 8:41:52 AM3/7/13
to maven-svn-revisi...@googlegroups.com
Ok, my mistake. I think I should run the plugin goal like this:

mvn svn-revision-number:revision

But then I get the error:

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'svn-revision-number'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-svn-revision-number-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Mar 07 13:38:51 GMT 2013
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------


Any help?

Oleg Estekhin

unread,
Mar 8, 2013, 3:20:14 AM3/8/13
to maven-svn-revisi...@googlegroups.com
Hi,
 
build/pluginManagement section usually used in multi-module projects where it provides common configuration for required plugins, but it does not bind plugins to the build lifecycle. This is why you did not see any mention of s-r-n plugin when you ran the maven with –debug switch.
 
To actually add the plugin to the build lifecycle you need to use plain build/plugins section in your pom.xml file. Using your example, you can simply remove <pluginManagement> and </pluginManagement> tags and leave everything else as is.
--
You received this message because you are subscribed to the Google Groups "maven-svn-revision-number-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-svn-revision-num...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruben Gomez

unread,
Mar 8, 2013, 4:32:28 AM3/8/13
to maven-svn-revisi...@googlegroups.com
That was it.

Thanks a lot for your help!!

Ruben
To unsubscribe from this group and stop receiving emails from it, send an email to maven-svn-revision-number-plugin+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages