OSGi - Jsoup imports its own packages #2145
Replies: 4 comments 1 reply
-
Hi @jhy, Any thoughts on this? 🙂 |
Beta Was this translation helpful? Give feedback.
-
Doesn't it have to? The packages get imported because the are used by jsoup. This is the Felix configuration: <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.9</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<instructions>
<Bundle-DocURL>https://jsoup.org/</Bundle-DocURL>
<Export-Package>org.jsoup.*</Export-Package>
<Import-Package>org.jspecify.annotations;version=!;resolution:=optional,*</Import-Package>
</instructions>
</configuration>
</plugin> And the resulting manifest:
Is there a different configuration you would suggest? |
Beta Was this translation helpful? Give feedback.
-
I'd suggest adding
This way the resulting manifest would be:
Importing the exported packages is the default mode for However, Jsoup is not a "traditional" bundle:
It's a library bundle. And for the later I found the recommendation not to import its own packages:
|
Beta Was this translation helpful? Give feedback.
-
Cool. Thank you! 🙂 |
Beta Was this translation helpful? Give feedback.
-
Hi!
I have noticed that with the current maven-bundle-plugin configuration the OSGi manifest is generated in way that Jsoup imports it's own packages. Is this being done on purpose?
I am asking because in my current project a 3rd-party bundle embeds and exports Jsoup (already notified the vendor not to do that) while the Jsoup bundle is also deployed standalone. The embedded Jsoup is a different version than the standalone one.
And in some cases, during deplyment, the standalone bundle imports the embedded Jsoup packages from the 3rd-party lib and exports them with that version. Making the version of the standalone packages unavailable.
Beta Was this translation helpful? Give feedback.
All reactions