Login  Register

Re: Gradle asciidoctor plugin v2 not working

Posted by DocEvaluator on Apr 25, 2019; 9:31am
URL: https://discuss.asciidoctor.org/Gradle-asciidoctor-plugin-v2-not-working-tp6865p6867.html

Thank you Dan, for the hints.
First of all, I upgraded to 2.1.0 and I also corrected (my mistake ) the .adoc file name. The upgrade to 2.1.0 did not make any difference, but because of the wrong file name, the task was not doing anything. Now it does something.
So, here's my updated "build.gradle":
buildscript {
    repositories {
        jcenter()
    }
}

plugins {
    id 'org.asciidoctor.jvm.base' version '2.1.0' // (1)
    id 'org.asciidoctor.jvm.convert' version '2.1.0' // (2)
}

asciidoctorj {
    version = '1.6.2' 
}

asciidoctor {
  println ("asciidoctor task")
  sourceDir  file('src/asciidoc')
  sources {
    include 'index.adoc'
  }
  outputDir  file('build/docs')
}

but Gradle gives me this ouput:

asciidoctor task

> Task :asciidoctor FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':detachedConfiguration2'.
> Cannot resolve external dependency org.asciidoctor:asciidoctorj:1.6.2 because no repositories are defined.
  Required by:
      project :
> Cannot resolve external dependency org.jruby:jruby-complete:9.1.0.0 because no repositories are defined.
  Required by:
      project :

The link of jorge aguilera did not help, because this was referencing some revealJS presentations. jorge was also adding the Maven repositories -- I also tried this, without effect. I would have been surprised, because jcenter() was also the only repository I had to add when I was working with the 1.5.x versions of the Gradle plugin.
(In addition to the missing examples you mentioned, I don't even find any useful examples for the 2.0.0 or 2.1.0 version in the internet...)