Announcement Announcement Module
Collapse
No announcement yet.
Spring Maven Archetype using Bundlor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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,

    Comment


    • #3
      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.

      Comment

      Working...
      X