Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version overridden when also referencing asciidoctor-pdf #239

Closed
mrotteveel opened this issue Jun 15, 2018 · 5 comments
Closed

Version overridden when also referencing asciidoctor-pdf #239

mrotteveel opened this issue Jun 15, 2018 · 5 comments
Labels
1.[56].x Issues related to the 1.5.x/1.6.x series long-open:maybe-close? question

Comments

@mrotteveel
Copy link
Contributor

mrotteveel commented Jun 15, 2018

When only using the html5 backend with asciidoctor-gradle-plugin 1.5.7, asciidoctorj 1.5.6 is used (the generated html has <meta name="generator" content="Asciidoctor 1.5.6.1">).

If I reference org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16 because I also want to generate PDF, then this is overridden and 1.5.5 is used (<meta name="generator" content="Asciidoctor 1.5.5">), even when explicitly specifying the version in the asciidoctorj tag. This probably happens because asciidoctorj-pdf:1.5.0-alpha.16 explicitly depends on asciidoctorj 1.5.5.

I'd expect the version declared in the asciidoctorj task to take precedence.

build.gradle:

defaultTasks 'clean', 'asciidoctor'

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
        //classpath 'org.asciidoctor:asciidoctorj:1.5.6'
        classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
    }
}

apply plugin: 'org.asciidoctor.convert'

repositories {
    jcenter()
}

asciidoctorj {
    // To override default version of asciidoctorj use: version = '1.x.y'
    version = '1.5.6'
}

asciidoctor {
    sourceDir 'src/docs'
    backends=['html5', 'pdf']
}

As a workaround, I need to explicitly add a dependency on org.asciidoctor:asciidoctorj:1.5.6 (uncomment it in the build.gradle above).

@ysb33r
Copy link
Member

ysb33r commented Jun 25, 2018

You can also do

classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16', {
    exclude module : 'asciidoctorj'
}

@ysb33r ysb33r added question 1.[56].x Issues related to the 1.5.x/1.6.x series labels Jul 1, 2018
@ysb33r
Copy link
Member

ysb33r commented Nov 4, 2018

@mrotteveel Have you managed to resolve this issue?

@mrotteveel
Copy link
Contributor Author

@ysb33r The workaround works, but I consider the behavior itself a bug.

@ysb33r
Copy link
Member

ysb33r commented Nov 5, 2018

This is resolved in the 2.0-alpha.3 release, where one can control the versions in a simplified way, but still with fine granularity.

You will definitely no longer need any of the buildscript ugliness of 1.5.x.

AAMOF you could just apply the org.asciidoctor.jvm.pdf plugin which will give you an asciidoctorPdf task.

@mrotteveel
Copy link
Contributor Author

Ok, thanks!

ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Nov 7, 2018
This is a temporary measure until clarity can be obtained from the
JRuby team why this failure is occurring on 9.2.0.+.
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Nov 7, 2018
This is a temporary measure until clarity can be obtained from the
JRuby team why this failure is occurring on 9.2.0.+.
@ysb33r ysb33r mentioned this issue Mar 22, 2019
28 tasks
@ysb33r ysb33r closed this as completed Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.[56].x Issues related to the 1.5.x/1.6.x series long-open:maybe-close? question
Projects
None yet
Development

No branches or pull requests

2 participants