Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-690

go-offline fails when optional dependencies cannot be resolved

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.2
    • None
    • go-offline
    • None

    Description

      Consider the following dummy project:

      <?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>
      

      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 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stephan202 Stephan Schroevers
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: