protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
971 stars 229 forks source link

How to correctly import maven dependency in the resulting plugin jar with apache felix? #1092

Open vivere-dally opened 1 year ago

vivere-dally commented 1 year ago

I am building a protege plugin and am struggling with making the jar so that Protege will load the project correctly. I made a stack post about it.

This is the error I'm encountering:

[FelixStartLevel] ERROR FrameworkSlf4jLogger    Error starting file:<someName>-1.0.jar
org.osgi.framework.BundleException: Unable to resolve <someName>[28](R 28.0): missing requirement [<someName>[28](R 28.0)] osgi.wiring.package; (osgi.wiring.package=org.neo4j.cypherdsl.core) Unresolved requirements: [[<someName>[28](R 28.0)] osgi.wiring.package; (osgi.wiring.package=org.neo4j.cypherdsl.core)]
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111) ~[org.apache.felix.main.jar:na]
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2117) ~[org.apache.felix.main.jar:na]
    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371) ~[org.apache.felix.main.jar:na]
    at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) [org.apache.felix.main.jar:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
ykazakov commented 1 year ago

Where is this package coming from?

org.neo4j.cypherdsl.core

You should either add this library as an OSGI "bundle" (copy the jar to the plugin folder) or "embed" this library in your jar. Note: maven dependencies are not the same as OSGI dependencies!

Take a look at this example, particularly at the use of the tag <Embed-Dependency> of the manifest.