Results 1 to 3 of 3

Thread: Spring Maven Archetype using Bundlor

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Location
    Mont-Saint-Hilaire, QC
    Posts
    16

    Default Spring Maven Archetype using Bundlor

    I think I found a little problem in the spring osgi maven archetype. It concerns the Bundle-Version header.

    When generating my project via M2Eclipse, maven created a pom file with bundlor as the Manifest file "manager" with some preset directives, namely:

    <manifestHeaders><![CDATA[Bundle-ManifestVersion: 2
    Bundle-Name: article-rest
    Bundle-Version: 0.0.1-SNAPSHOT
    Bundle-SymbolicName: article-rest
    Spring-DM-Version: ${spring.osgi.version}
    ]]></manifestHeaders>

    It appears that when installing this bundle in my local repository, and then loading it in my servicemix4 server, I get this exception:

    servicemix osgi> install -s mvn:com.testing.rest/article-rest
    java.lang.NumberFormatException: For input string: "1-SNAPSHOT"
    at java.lang.NumberFormatException.forInputString(Num berFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:456)
    at java.lang.Integer.parseInt(Integer.java:497)
    at org.osgi.framework.Version.<init>(Version.java:136 )
    %< snip

    I fixed it by setting the Bundle-version header to:
    0.0.1.SNAPSHOT instead of 0.0.1-SNAPSHOT

    Now it works.

  2. #2
    Join Date
    Feb 2005
    Location
    Curitiba, Brazil
    Posts
    46

    Default Exception with -SNAPSHOT manifest versions, but not with .SNAPSHOT

    Hi all,

    I would like to suggest to the developers of the com.springsource.bundlor.maven mojo to strip the -SNAPSHOT when it shows in a manifest template or configuration. I suppose that other maven plugins like "release" may not work properly with the .SNAPSHOT suffix.

    Regards,

  3. #3
    Join Date
    Oct 2008
    Posts
    493

    Default

    You may be interested in BNDLR-245 which concerns this problem.

    Alternatively, you can specify an OSGi-compatiable version in your pom file, e.g. <version>1.0.0.SNAPSHOT</version>, which will then be used by Bundlor to set the value of the Bundle-Version header.
    Andy Wilkinson
    SpringSource

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •