You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stephan Schroevers (Jira)" <ji...@apache.org> on 2020/04/20 14:21:00 UTC

[jira] [Created] (MDEP-690) go-offline fails when optional dependencies cannot be resolved

Stephan Schroevers created MDEP-690:
---------------------------------------

             Summary: 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


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)