[
https://issues.apache.org/jira/browse/MNG-5866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14648967#comment-14648967
]
Henry Hoendervangers commented on MNG-5866:
-------------------------------------------
Of course you are right that org.freemarker:freemarker needs the test scope,
but the problem remains the same. I don't use any freemarker code in my
project. That means also not in my test packages. I have to declare it as a
non-transitive dependency because hibernate-tools needs it. And all
non-transitive dependencies that are unused are picked up by the dependency
plugin. Our build fails on warning. Of course you can add an exception in the
plugin configuration but that's not solving the real problem.
> A way to replace a transitive dependency
> ----------------------------------------
>
> Key: MNG-5866
> URL: https://issues.apache.org/jira/browse/MNG-5866
> Project: Maven
> Issue Type: New Feature
> Components: Dependencies
> Affects Versions: 3.3.3
> Environment: all
> Reporter: Henry Hoendervangers
> Priority: Minor
>
> we need a way to replace a transitive dependency. It is needed because the
> dependency:analyze will throw a warning if you exclude the transitive
> dependency and declare another dependency to replace the transitive
> dependency. For example:
> {code}
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-tools</artifactId>
> <scope>test</scope>
> <exclusions>
> <exclusion>
> <groupId>freemarker</groupId>
> <artifactId>freemarker</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> <dependency>
> <groupId>org.freemarker</groupId>
> <artifactId>freemarker</artifactId>
> </dependency>
> {code}
> this will cause dependency:analyze to throw a warning on the
> org.freemarker:freemarker dependency because it's unused.
> possible sollution:
> {code}
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-tools</artifactId>
> <scope>test</scope>
> <exclusions>
> <exclusion>
> <groupId>freemarker</groupId>
> <artifactId>freemarker</artifactId>
> </exclusion>
> </exclusions>
> <inclusions>
> <inclusion>
> <groupId>org.freemarker</groupId>
> <artifactId>freemarker</artifactId>
> </inclusion>
> </inclusions>
> </dependency>
> {code}
> org.freemarker:freemarker can now be marked as transitive. It would also be
> nice to be able to replace a transitive dependency with more than 1
> dependency.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)