Topics

Packaging bundle vs jar


Arjan Tijms
 

Hi,

I noticed this commit: https://github.com/javaee-security-spec/soteria/commit/421b6f001c31cd3d64bad0b0f62807ebbb1c7712

Where the comment said "bundle" is needed for GF integration. However JSF/Mojarra used "jar", and obviously has been integrated in GF as well.

The bundle (OSGi) information (MANIFEST.MF mostly) should be added to the jar, even without the maven project type being "bundle". 

Wondering what problems were exactly encountered, but I'm fairly sure packaging "bundle" should not be needed as I integrated Soteria into Payara without any issues.

Kind regards,
Arjan Tijms


Will Hopkins
 

What we really need is the OSGi manifest information, but choosing "bundle" seemed like the easiest way to get that.

It had previously been set as "bundle", and the GF integration was working. Was there a reason for the change to "jar"?

On 07/20/2017 11:16 AM, Arjan Tijms wrote:
Hi,

I noticed this commit: https://github.com/javaee-security-spec/soteria/commit/421b6f001c31cd3d64bad0b0f62807ebbb1c7712

Where the comment said "bundle" is needed for GF integration. However JSF/Mojarra used "jar", and obviously has been integrated in GF as well.

The bundle (OSGi) information (MANIFEST.MF mostly) should be added to the jar, even without the maven project type being "bundle". 

Wondering what problems were exactly encountered, but I'm fairly sure packaging "bundle" should not be needed as I integrated Soteria into Payara without any issues.

Kind regards,
Arjan Tijms

-- 
Will Hopkins | WebLogic Security Architect | +1.781.442.0310
Oracle Application Development
35 Network Drive, Burlington, MA 01803


Werner Keil
 

If you use Apache Felix, then sure, "bundle" is perfectly fine.

Works for JSRs like 363: https://github.com/unitsofmeasurement/unit-ri/blob/master/pom.xml
or 354: https://github.com/JavaMoney/jsr354-ri/blob/master/pom.xml

Werner


Arjan Tijms
 

Hi,

On Thursday, July 20, 2017, Will Hopkins <will.hopkins@...> wrote:
What we really need is the OSGi manifest information, but choosing "bundle" seemed like the easiest way to get that.

It had previously been set as "bundle", and the GF integration was working. Was there a reason for the change to "jar"?

The IDE (Eclipse) didn't seem to be quite happy with it. Wonder if the end result actually differs with either "bundle" or "jar". Both should produce a .jar with a META-INF/MANIFEST.MF.

Kind regards,
Arjan Tijms
 


On 07/20/2017 11:16 AM, Arjan Tijms wrote:
Hi,

I noticed this commit: https://github.com/javaee-security-spec/soteria/commit/421b6f001c31cd3d64bad0b0f62807ebbb1c7712

Where the comment said "bundle" is needed for GF integration. However JSF/Mojarra used "jar", and obviously has been integrated in GF as well.

The bundle (OSGi) information (MANIFEST.MF mostly) should be added to the jar, even without the maven project type being "bundle". 

Wondering what problems were exactly encountered, but I'm fairly sure packaging "bundle" should not be needed as I integrated Soteria into Payara without any issues.

Kind regards,
Arjan Tijms

-- 
Will Hopkins | WebLogic Security Architect | +1.781.442.0310
Oracle Application Development
35 Network Drive, Burlington, MA 01803

 


Werner Keil
 

As an Eclipse Plugin/Bundle?

Especially JSR 363 and all relevant implementations plus extension modules are used by Eclipse projects like Smart Home without problems.
I know, some of these Maven plugins can be a little tricky, if the issues persist, I could ask Chris Senior to have a look, he helped us with OSGi metadata in those bundles and also uses them with major clients, so there everything works...

Werner


Will Hopkins
 

I use eclipse but not the maven plugin (just because I'm not familiar with it).

The symptom was that the jars did not jave OSGi info in them (or, indeed, a MANIFEST.MF file of any sort), so they couldn't be integrated with GF.

There may be other ways to fix it, but I was trying to do the simple thing to get it working, which was to restore the bundle packaging. The API jar currently uses bundle packaging as well, BTW.

There may also be another issue, possibly related to the changes to the snapshot repository. When I tried to do a release last night, everything worked (version numbers integrated, successful build/test, etc.), and it looked like it was uploading the binaries, but they never showed up in the staging repository. It shouldn't be necessary to specify the jvnet snapshot repo, since the jvnet-parent pom already declares it. I haven't had a chance to look at it any further.

Will

On 07/20/2017 01:02 PM, Arjan Tijms wrote:
Hi,

On Thursday, July 20, 2017, Will Hopkins <will.hopkins@...> wrote:
What we really need is the OSGi manifest information, but choosing "bundle" seemed like the easiest way to get that.

It had previously been set as "bundle", and the GF integration was working. Was there a reason for the change to "jar"?

The IDE (Eclipse) didn't seem to be quite happy with it. Wonder if the end result actually differs with either "bundle" or "jar". Both should produce a .jar with a META-INF/MANIFEST.MF.

Kind regards,
Arjan Tijms
 


On 07/20/2017 11:16 AM, Arjan Tijms wrote:
Hi,

I noticed this commit: https://github.com/javaee-security-spec/soteria/commit/421b6f001c31cd3d64bad0b0f62807ebbb1c7712

Where the comment said "bundle" is needed for GF integration. However JSF/Mojarra used "jar", and obviously has been integrated in GF as well.

The bundle (OSGi) information (MANIFEST.MF mostly) should be added to the jar, even without the maven project type being "bundle". 

Wondering what problems were exactly encountered, but I'm fairly sure packaging "bundle" should not be needed as I integrated Soteria into Payara without any issues.

Kind regards,
Arjan Tijms

-- 
Will Hopkins | WebLogic Security Architect | +1.781.442.0310
Oracle Application Development
35 Network Drive, Burlington, MA 01803

 

-- 
Will Hopkins | WebLogic Security Architect | +1.781.442.0310
Oracle Application Development
35 Network Drive, Burlington, MA 01803


Werner Keil
 

Then please have a look at the RI of JSR 363 just to give you one example:
https://github.com/unitsofmeasurement/unit-ri/blob/master/pom.xml

The resulting JAR can be found on MavenCentral: https://search.maven.org/#search%7Cga%7C1%7Ctec.units
OSGi info. A few additional details come from the maven-jar-plugin, everything else from Apache Felix maven-bundle-plugin.

HTH,
Werner