asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
283 stars 120 forks source link

Plugin includes multiple versions of the same dependency #709

Open tylerbertrand opened 6 months ago

tylerbertrand commented 6 months ago

The plugin includes multiple versions of the jruby-complete dependency.

This causes conflicts during dependency resolution, and results in failed builds when applied to a build with failOnVersionConflict enabled.

It looks like this code adds the asciidoctorj dependency, then adds jruby-complete with the version provided by minimumSafeJrubyVersion, which is currently set to 9.1.0.0. I believe this should be updated to 9.3.8.0, which is the version used in asciidoctorj:2.5.7.

Tested against plugin version 4.0.1.

dubinsky commented 1 month ago

I am not sure that the pull request https://github.com/asciidoctor/asciidoctor-gradle-plugin/pull/714 is sufficient: with 4.0.2 and

asciidoctorj {
    version = '2.5.13'
    jrubyVersion = '9.4.7.0'
    modules.pdf.version '2.3.15'
}

I see in the Gradle dependencies report multiple versions of dependencies not just for JRuby:

__$$asciidoctorj$$___d (n)
+--- org.asciidoctor:asciidoctorj:2.5.7 (n)
+--- org.jruby:jruby-complete:9.1.0.0 (n)
\--- org.asciidoctor:asciidoctorj-pdf:2.3.10 (n)

__$$asciidoctorj$$___r
+--- org.asciidoctor:asciidoctorj:2.5.7
|    \--- org.jruby:jruby:9.3.8.0 -> org.jruby:jruby-complete:9.3.8.0
+--- org.jruby:jruby-complete:9.1.0.0 -> 9.3.8.0
\--- org.asciidoctor:asciidoctorj-pdf:2.3.10

__$$asciidoctorj_asciidoctor$$__d (n)
+--- org.asciidoctor:asciidoctorj:2.5.7 (n)
+--- org.jruby:jruby-complete:9.1.0.0 (n)
\--- org.asciidoctor:asciidoctorj-pdf:2.3.10 (n)

__$$asciidoctorj_asciidoctor$$__r
+--- org.asciidoctor:asciidoctorj:2.5.7 -> 2.5.13
|    \--- org.jruby:jruby:9.4.7.0 -> org.jruby:jruby-complete:9.4.7.0
+--- org.jruby:jruby-complete:9.1.0.0 -> 9.4.7.0
\--- org.asciidoctor:asciidoctorj-pdf:2.3.10 -> 2.3.15