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 f14ed822 [MRESOLVER-571] Import o.e.aether packages with the exact
same version
f14ed822 is described below
commit f14ed822655c26d6a76ff4d513190b4035e38693
Author: Hannes Wellmann <[email protected]>
AuthorDate: Wed Jun 19 16:04:59 2024 +0200
[MRESOLVER-571] Import o.e.aether packages with the exact same version
The documentation states that only maven-resolver artifacts of the exact
same version should be used together.
With this change all org.eclipse.aether* packages are now imported with
a strict version range of
'org.eclipse.aether*;version="[@version,@version]"'
Fixes https://issues.apache.org/jira/browse/MRESOLVER-571
---
maven-resolver-impl/pom.xml | 1 +
pom.xml | 13 ++++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/maven-resolver-impl/pom.xml b/maven-resolver-impl/pom.xml
index 87f3d607..f82feff7 100644
--- a/maven-resolver-impl/pom.xml
+++ b/maven-resolver-impl/pom.xml
@@ -35,6 +35,7 @@
<bnd.instructions.additions><![CDATA[
# Mark optional Maven dependencies as optional
Import-Package: \
+
org.eclipse.aether*;version="${range;[===,===];${mavenResolverVersion}}", \
org.slf4j.spi;version="[1.7,3)", \
javax.inject;resolution:=optional,\
com.google.inject*;resolution:=optional, \
diff --git a/pom.xml b/pom.xml
index 8c96a4f8..2b3fc237 100644
--- a/pom.xml
+++ b/pom.xml
@@ -474,13 +474,16 @@
<bnd><![CDATA[
Bundle-SymbolicName:
org.apache.${replacestring;${project.artifactId};-;.}
Automatic-Module-Name: ${Bundle-SymbolicName}
- # Export packages not containing the substring 'internal'
+ # Export packages, but don't re-import own packages
-exportcontents: \
- *.impl.*;x-internal:=true, \
- *.internal.*;x-internal:=true, \
- *
- # Mark optional Maven dependencies as optional
+ *.impl.*;x-internal:=true;-noimport:=true, \
+ *.internal.*;x-internal:=true;-noimport:=true, \
+ *;-noimport:=true
+ # Ensure only maven-resolver packages of exactly the same
version are imported
+ # and mark optional Maven dependencies as optional.
+
mavenResolverVersion=${versionmask;===;${version_cleanup;${project.version}}}
Import-Package: \
+
org.eclipse.aether*;version="${range;[===,===];${mavenResolverVersion}}", \
javax.inject*;resolution:=optional, \
*
# Reproducible build