[ https://issues.apache.org/jira/browse/MNG-6724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16892107#comment-16892107 ]
Robert Scholte commented on MNG-6724: ------------------------------------- In case of expectations: this is not going to happen in Maven 3. Since the pom.xml that's being used on the local system is exactly the same as the one being published, we can't introduce new elements. https://cwiki.apache.org/confluence/display/MAVEN/POM+Model+Version+5.0.0 might be of interest to have a look at. It is a huge list of possible changes to the model. > 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)