Skip to content

Commit

Permalink
[MRESOLVER-572] Export internal packages in OSGi metadata as x-internal
Browse files Browse the repository at this point in the history
This makes maven-resolver-supplier usable as bundle in an OSGi runtime.
At the moment the bundle cannot resolve because the internal.impl
packages it uses and imports in its OSGi metadata are not exported by
maven-resolver-impl.

Simply exporting internal packages fixes that and, although it is
discouraged to use internal/impl packages, gives consumers that can
accept no API-compatibility guarantees the ability to access these
packages.
Adding the directive 'x-internal' is a convention that, at least when
using Eclipse PDE, shows a corresponding warning at call-sides.

Fixes https://issues.apache.org/jira/browse/MRESOLVER-572
  • Loading branch information
iils-hwellmann committed Jun 26, 2024
1 parent 52b4db3 commit cf895a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@
Bundle-SymbolicName: org.apache.${replacestring;${project.artifactId};-;.}
Automatic-Module-Name: ${Bundle-SymbolicName}
# Export packages not containing the substring 'internal'
-exportcontents: ${removeall;${packages};${packages;NAMED;*internal*}}
-exportcontents: \
*.impl.*;x-internal:=true, \
*.internal.*;x-internal:=true, \
*
# Reproducible build
-noextraheaders: true
${bnd.instructions.additions}
Expand Down

0 comments on commit cf895a4

Please sign in to comment.