You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2024/06/27 20:47:49 UTC
(maven-resolver) branch master updated: [MRESOLVER-572] Export internal packages in OSGi metadata as x-internal
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
The following commit(s) were added to refs/heads/master by this push:
new d0edd794 [MRESOLVER-572] Export internal packages in OSGi metadata as x-internal
d0edd794 is described below
commit d0edd7942f7af7732bccf6a7e68d0321906c6379
Author: Hannes Wellmann <ha...@iils.de>
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 b707a464..0f9f9bb6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -610,7 +610,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, \