Skip to content

Commit f14ed82

Browse files
iils-hwellmanngnodet
authored andcommitted
[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
1 parent 5b8f47a commit f14ed82

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

maven-resolver-impl/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<bnd.instructions.additions><![CDATA[
3636
# Mark optional Maven dependencies as optional
3737
Import-Package: \
38+
org.eclipse.aether*;version="${range;[===,===];${mavenResolverVersion}}", \
3839
org.slf4j.spi;version="[1.7,3)", \
3940
javax.inject;resolution:=optional,\
4041
com.google.inject*;resolution:=optional, \

pom.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,13 +474,16 @@
474474
<bnd><![CDATA[
475475
Bundle-SymbolicName: org.apache.${replacestring;${project.artifactId};-;.}
476476
Automatic-Module-Name: ${Bundle-SymbolicName}
477-
# Export packages not containing the substring 'internal'
477+
# Export packages, but don't re-import own packages
478478
-exportcontents: \
479-
*.impl.*;x-internal:=true, \
480-
*.internal.*;x-internal:=true, \
481-
*
482-
# Mark optional Maven dependencies as optional
479+
*.impl.*;x-internal:=true;-noimport:=true, \
480+
*.internal.*;x-internal:=true;-noimport:=true, \
481+
*;-noimport:=true
482+
# Ensure only maven-resolver packages of exactly the same version are imported
483+
# and mark optional Maven dependencies as optional.
484+
mavenResolverVersion=${versionmask;===;${version_cleanup;${project.version}}}
483485
Import-Package: \
486+
org.eclipse.aether*;version="${range;[===,===];${mavenResolverVersion}}", \
484487
javax.inject*;resolution:=optional, \
485488
*
486489
# Reproducible build

0 commit comments

Comments
 (0)