[ https://issues.apache.org/jira/browse/MNG-6724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16892060#comment-16892060 ]
Thorsten Glaser edited comment on MNG-6724 at 7/24/19 6:17 PM: --------------------------------------------------------------- A substitution XML element must have exactly one exclusion XML element (of which only groupId and artifactId are used, the others are silently ignored) and may have one or more dependency XML elements, which are substituted (here, similarily, only groupId and artifactId are used, the version MUST be set using dependencyManagement→dependencies→dependency for this artifact). If the dependency elements are missing, the excluded dependency is globally removed. was (Author: mirabilos): A substitution XML element must have exactly one exclusion XML element (of which only groupId and artifactId are used, the others are silently ignored) and may have one or more dependency XML elements, which are substituted. If the dependency elements are missing, the excluded dependency is globally removed. > Ability to exchange dependencies > -------------------------------- > > Key: MNG-6724 > URL: https://issues.apache.org/jira/browse/MNG-6724 > Project: Maven > Issue Type: New Feature > Reporter: Thorsten Glaser > Priority: Minor > > Feature Request: I would like to have the explicit ability to exchange > dependencies globally, such as from dependencyManagement. > Currently, I can do <excludes> on a dependency’’s transitive dependency, then > add an explicit <dependency> to the POM of my final WAR (and possibly a > test-scoped one on the JAR it’s in), but that makes the > maven-dependency-plugin:3.1.1:analyze-only goal complain about a declared but > unused dependency. > With the javax.* → jakarta moves (and some others, e.g. I need the > com.sun.activation version of jakarta.activation instead of the Jakarta one) > and multiple JAXB implementations around, this is becoming troublesome. > Therefore, I would like for Maven to allow something like this: > {code:java} > <dependencyManagement> > <substitutions> > <substitution> > <exclusion> > <groupId>javax.xml.bind</groupId> > <artifactId>jaxb-api</artifactId> > </exclusion> > <dependency> > <groupId>jakarta.xml.bind</groupId> > <artifactId>jakarta.xml.bind-api</artifactId> > </dependency> > </substitution> > <!-- … --> > </substitutions> > <dependencies> > <dependency> > <groupId>jakarta.xml.bind</groupId> > <artifactId>jakarta.xml.bind-api</artifactId> > <version>${jaxb-api.version}</version> > </dependency> > <!-- … --> > </dependencies> > </dependencyManagement> > {code} > This would recursively replace the old JAXB-API with the new one but not add > them where unnecessary, and make the maven-dependency-plugin’s checks do the > right thing. > Thanks in advance for consideration! -- This message was sent by Atlassian JIRA (v7.6.14#76016)