-
Type:
Improvement
-
Status: Resolved
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: None
Maven metadata allows for 'optional' dependencies, which is quite important for frameworks like Spring, where we must compile against certain artifacts, but use by end users is optional (i.e. if they don't use particular classes, they don't need the dependency).
Ivy allows for expressing this, Maven allows for expressing this.
What we need is something like:
dependencies { compile "net.sourceforge.jopt-simple:joptsimple:3.0.0" { optional = true } }
And for that to be reflected in the generated pom.xml as:
<dependency>
<groupId>net.sourceforge.jopt-simple</groupId>
<artifactId>joptsimple</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
See also: http://gradle.1045684.n5.nabble.com/Marking-Maven-Dependencies-as-optional-td1432582.html