This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch maven-resolver-1.9.x
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
The following commit(s) were added to refs/heads/maven-resolver-1.9.x by this
push:
new 5b8f47a5 [MRESOLVER-572] Export internal packages in OSGi metadata as
x-internal
5b8f47a5 is described below
commit 5b8f47a5a96ffb8e7ea8152b18eadc8356bd8c87
Author: Hannes Wellmann <[email protected]>
AuthorDate: Wed Jun 19 17:27:13 2024 +0200
[MRESOLVER-572] Export internal packages in OSGi metadata as x-internal
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
---
pom.xml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index d6caaca9..8c96a4f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -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, \
+ *
# Mark optional Maven dependencies as optional
Import-Package: \
javax.inject*;resolution:=optional, \