You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wurzelbert <ja...@goerlitz.com> on 2011/07/01 10:26:49 UTC

buildnumber-maven-plugin and service mix bundle

Hi,

I'm pretty new to SMX with maven and have a problem with the buildnumber
plugin in combination with osgi bundling.

My pom contains:
---
<parent>
                <groupId>org.apache.servicemix.features</groupId>
                <artifactId>features</artifactId>
                <version>4.3.0</version>
        </parent>
...
<packaging>bundle</packaging>
<version>1.0.${buildNumber}</version>
...
<plugin>
                                <groupId>org.codehaus.mojo</groupId>
                               
<artifactId>buildnumber-maven-plugin</artifactId>
                                <version>1.0</version>
                                <executions>
                                        <execution>
                                                <phase>validate</phase>
                                                <goals>
                                                <goal>create</goal>
                                                </goals>
                                                <configuration>
                                                       
<doCheck>false</doCheck>
                                                       
<doUpdate>true</doUpdate>
                                                       
<useLastCommittedRevision>true</useLastCommittedRevision>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>


While building the bundle I see in the console:
 [INFO] Storing buildNumber: 54 at timestamp: 1309442078694
so the plugins is getting the version number correctly but my jar file has
still the "${buildNumber}" thing in its name ...
I've been playing around with goals and phases without success.

I've also changed the packaging to jar and then it's working !!! but it
isn't an installable bundle for smx...
The param -DbuildNumber=123 is working too.

What is the problem? Please help me ! 

--
View this message in context: http://maven.40175.n5.nabble.com/buildnumber-maven-plugin-and-service-mix-bundle-tp4541357p4541357.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: buildnumber-maven-plugin and service mix bundle

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

> <packaging>bundle</packaging>
> <version>1.0.${buildNumber}</version>
That will not work....cause at the time this will be expanded the build 
number plugin has not ran ...yet...this would mean to re-read the pom 
and interpret it a second time...(which maven doesn't do!)....

> While building the bundle I see in the console:
>   [INFO] Storing buildNumber: 54 at timestamp: 1309442078694
> so the plugins is getting the version number correctly but my jar file has
> still the "${buildNumber}" thing in its name ...
What you can do is to change the name of the resulting artifact by using
<finalName>....${buildNumber}</finalName>

Or

A good place to put the information is into the MANIFEST.MF file...can 
be achieved by using the Maven Jar Plugin 
(http://maven.apache.org/plugins/maven-jar-plugin/examples/manifest-customization.html)..

But usually i would say the version number is enough (like 1.2.3 etc.) 
...a kind of buildNumber or Version number (from VCS) is not a good idea...

> I've also changed the packaging to jar and then it's working !!! but it
> isn't an installable bundle for smx...
> The param -DbuildNumber=123 is working too.
See explanation at the top...

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org