Skip to content

Commit

Permalink
[MRESOLVER-571] Import o.e.aether packages with the exact same version
Browse files Browse the repository at this point in the history
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
  • Loading branch information
iils-hwellmann authored and gnodet committed Jul 1, 2024
1 parent 5b8f47a commit f14ed82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions maven-resolver-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
13 changes: 8 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f14ed82

Please sign in to comment.