felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: Problems with bundle version strings produced by maven-osgi-plugin
Date Thu, 07 Dec 2006 18:22:26 GMT
Steven E. Harris wrote:
> "Steven E. Harris" <seh@panix.com> writes:
>
>   
>> apparently the older Maven plugin doesn't generate proper version
>> strings
>>     
>
> Here's the problem from
>
>   tools/maven2/maven-osgi-plugin/
>   src/main/java/org.apache.felix.tools/maven/plugin/OsgiJarMojo.java:
>
> ,----
> |         private void addBundleVersion() {
> |             // Maven uses a '-' to separate the version qualifier,
> |             // while OSGi uses a '.', so we need to convert to a '.'
> |             String version = project.getVersion().replace('-', '.');
> |             osgiManifest.setBundleVersion(version);
> |         }
> `----
>
> Here's a fix:
>
>         private void addBundleVersion() {
>             // Maven uses a '-' to separate the version qualifier,
>             // while OSGi uses a '.', so we need to convert the first '-' to a '.'
>             final String version = project.getVersion().replaceFirst("((^|\\.)[0-9]+)-",
>                                                                      "$1.");
>             osgiManifest.setBundleVersion(version);
>         }
>   

Ok, thanks. I will add this to the old plugin now.

-> richard


Mime
View raw message