bnd allows you to include files. So you could setup a central file that is included by all your osgi

        # central.bnd
        export-version = 3.0

        #osgi.bnd
        -include = ../../central.bnd
        -exportcontents = *; version= ${export-version}

Maybe in the maven plugin they version of the pom might be available as a property. in that case, you can use that property, but then you have to use the maven_version macro to make sure you have a valid OSGi version.

That said, I am not sure it is a good idea to connect pom versions to package exports. I guess this is ok for implementation packages but impl. packages should not be exported ... In a properly designed module you should have carefully versioned specification packages and implementation packages should remain private.

Yes, yes, I do understand legacy problems :-)

Kind regards,

        Peter Kriens


On 17 okt 2008, at 16:55, Sahoo wrote:

Stuart McCulloch wrote:
2008/10/17 Sahoo <[EMAIL PROTECTED]>


My project has a lot of subprojects that get released together. I want packages exported as part of all the bundles to have same version attribute. I can't rely on automatic conversion of maven version to OSGi version because while 3.0.0-SNAPSHOT < 3.0.0 in maven, the corresponding mapped OSGi versions behave differently, i.e. 3.0.0.SNAPSHOT > 3.0.0 in OSGi. SO, I would like to set the package version as 3.0. Do I have to specify it in
every Export-Package/_exportcontents instruction?



well, you have to tell BND to use that particular version (3.0) somehow
- but you should be able to take advantage of Maven to ease the pain

for example, you could try setting a property in one of the parent poms
and then use that in the Export-Package/_exportcontents instructions


I wanted to avoid having to specify this property expression in every Export-Package instruction. I was asking if there was any property that I could set for maven bundle plugin to use if no version was explicitly specified. Looks like the answer is no. BTW, I once remember Peter mentioning about some macro called maven_version. This is what he wrote:

/Peter Kriens commented on FELIX-677:
------------------------------------

I am getting afraid there is no end to the places where I have to clean up maven version. I therefore have added a macro $ {maven_version;1.0-SNAPSHOT} that will convert the maven version string to an OSGi version string. You can use macros and properties inside macros./


How does one take advantage of this?
btw - do you have a more concrete example for this usecase?

Yes, I am doing it in GlassFish project, where we build close to 80 bundles and it's a bit painful to go and change all 80 osgi.bundle files with version information.
(also I guess this relates to your other question about exportcontents)

Yes, because of exportcontents issue, I am forced to use Export- Package in my osgi.bundle file.

Thanks,
Sahoo

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to