[ 
https://issues.apache.org/jira/browse/MDEP-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17294768#comment-17294768
 ] 

Tavin Cole commented on MDEP-690:
---------------------------------

Our project also breaks because of nonexistent optional transitive 
dependencies. And of course we don't want to burn time and storage downloading 
jars that won't be used. Stephen Coy is right, these should never be downloaded 
by default, but a configuration option to enable downloading them would be 
acceptable.

> go-offline fails when optional dependencies cannot be resolved
> --------------------------------------------------------------
>
>                 Key: MDEP-690
>                 URL: https://issues.apache.org/jira/browse/MDEP-690
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: go-offline
>    Affects Versions: 3.1.2
>            Reporter: Stephan Schroevers
>            Priority: Major
>
> Consider the following dummy project:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> https://maven.apache.org/xsd/maven-4.0.0.xsd";>
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>com.example</groupId>
>     <artifactId>example</artifactId>
>     <version>0.0.1-SNAPSHOT</version>
>     <dependencies>
>         <dependency>
>             <groupId>io.projectreactor.addons</groupId>
>             <artifactId>reactor-extra</artifactId>
>             <version>3.3.3.RELEASE</version>
>         </dependency>
>     </dependencies>
> </project>
> {code}
> Running {{org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline}} 
> against this project passes. With version 3.1.2 the goal fails with:
> {noformat}
> org.eclipse.aether.resolution.DependencyResolutionException: Could not find 
> artifact org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.5.2 in 
> central (https://repo.maven.apache.org/maven2)
> {noformat}
> The reason for the failure appears to be that {{reactor-extra}} declares an
> [optional|https://repo1.maven.org/maven2/io/projectreactor/addons/reactor-extra/3.3.3.RELEASE/reactor-extra-3.3.3.RELEASE.pom]
>  dependency on {{org.eclipse.swt.gtk.linux.x86_64}}, an artifact which is not 
> present in Maven Central.
> It'd be nice if the version 3.1.1 behavior of the plugin could be reinstated. 
> Alternatively (perhaps better?) it should be possible to conditionally 
> exclude optional dependencies, just like the goal allows one to exclude 
> dependencies by artifact ID, group ID, classifier, scope and type.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to