apache / apache/maven-dependency-plugin

[MDEP-690] go-offline fails when optional dependencies cannot be resolved

Open
#1,200 4 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
175
Forks
196
Avg merge
19h 30m
Merged PRs (30d)
5

Description

**[Stephan Schroevers](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=stephan202)** opened **[MDEP-690](https://issues.apache.org/jira/browse/MDEP-690?redirect=false)** and commented

Consider the following dummy project:

```xml

4.0.0

com.example
example
0.0.1-SNAPSHOT



io.projectreactor.addons
reactor-extra
3.3.3.RELEASE

```

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:

```
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)
```

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.

---

**Affects:** 3.1.2

2 votes, 5 watchers

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline and 3.1.2:go-offline entry points, using the dummy project and reactor-extra dependency described in the issue. Compare dependency resolution for the optional SWT artifact; done means go-offline no longer fails as in 3.1.2, or supports the requested conditional exclusion behavior, with coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.