Skip to content

Add OSGI header manifest and update java version#5

Open
ChristianLutz wants to merge 3 commits intoEXIficient:masterfrom
ChristianLutz:master
Open

Add OSGI header manifest and update java version#5
ChristianLutz wants to merge 3 commits intoEXIficient:masterfrom
ChristianLutz:master

Conversation

@ChristianLutz
Copy link

In the provided PR we updated to the current java 8 version.
Because if you used eclipse with version 5 as defined in the pom. There are some errors.

And we added the OSGI header, so it is possible to use exificient in a karaf + cxf environment.

@danielpeintner
Copy link
Member

Hi Christian,

can you describe why you want to set the requirements to Java8.
We use Eclipse with Java5 and also need the project be compilable with Java 5.

Hence I would tend to stick to what we have unless there is a real issue.

Moreover, Can you explain why the pom.xml needs to be changed?

Thanks!

@ChristianLutz
Copy link
Author

Hello Daniel,

after opening the latest version within eclipse (4.6) the following error "The method .. of type .. must override a superclass" occurs. So we had at least to increase the version up to java 6 to get rid of the error. So after the need to update the java version we just updated to the newest version. But there is no need to for us to switch to the newest version.

The pom change extends the manifest file within you jar to provide an OSGI header. This allows us to deploy the exificient bundle within an osgi container like felix or equinox. Please see link for more details about OSGI.

@danielpeintner
Copy link
Member

Hi,

I did fix the reason that caused your errors in f1dca3c.

Please let me know whether this resolves your issues/PR.

As said, I need to keep Java5 dependency.

W.r.t. change the POM with OSGI dependencies that we don't need I am bit reluctant. I am pretty sure there are other ways to do that without changing the original POM that has nothing to do with OSGI. Does that make sense?

Thanks,

-- Daniel

@ChristianLutz
Copy link
Author

Hello Daniel,

there aren't any side effect for non OSGI environments. And you are right, useally there is an easy workaround for all non OSGI conform jar file. In Karaf this is called Wrap.

But this isn't working for exificient because this tool by default exports all packages. Now this leads to a package conflict, because exificient-core and exificient itselft are containing the same package names in the same path. For more information please see this explanation

I hope this helps a bit to understand why I provided the above PR.

Thank you. - Christian

@danielpeintner
Copy link
Member

2287c76 integrates proposed changes.

Please close PR if it resolves your issue

@danielpeintner
Copy link
Member

Note: there seem to be side effects (see https://travis-ci.org/EXIficient/exificient-core/jobs/210546923)

When running with Java6 I get the following issues. IF we cannot settle this (please provide solution) I will revert the changes...

[INFO] --- maven-bundle-plugin:3.2.0:bundle (default-bundle) @ exificient-core ---
[WARNING] Error injecting: org.apache.felix.bundleplugin.BundlePlugin
java.lang.UnsupportedClassVersionError: aQute/bnd/osgi/Analyzer : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

@ChristianLutz
Copy link
Author

Hello,

I will check this. And update the PR.

Thanks

@danielpeintner
Copy link
Member

Hi @ChristianLutz

We recently updated EXIficient to be compliant with Java9 (each project having its own package)

But this isn't working for exificient because this tool by default exports all packages. Now this leads to a package conflict, because exificient-core and exificient itselft are containing the same package names in the same path. For more information please see this explanation

According to my understanding the version "1.0.0-SNAPSHOT" should resolve the issue you had with the workaround for OSGI.

Would be great if you can confirm this.

Thanks!

@ChristianLutz
Copy link
Author

Thank you for the update. I'll try and let you know.

@raner
Copy link

raner commented Oct 3, 2021

It looks like this PR has been stale for a long time, but FWIW, there is a solution for the folks out there who would like to use EXIficient in an OSGi environment: https://mvnrepository.com/artifact/org.opendaylight.netconf/shaded-exificient/2.0.5

This JAR is basically a re-bundling of the original EXIficient JARs together with a proper OSGi manifest and is therefore suitable for loading into an OSGi container. I'm using Equinox, and successfully incorporated this JAR via the org.reficio/p2-maven-plugin.

Nawroski pushed a commit to Nawroski/exificient-core that referenced this pull request Dec 6, 2022
Add unit test to demonstrate NPE issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants