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

asciidoctorj-pdf error when processing #857

Closed
yami12376 opened this issue Oct 22, 2019 · 11 comments
Closed

asciidoctorj-pdf error when processing #857

yami12376 opened this issue Oct 22, 2019 · 11 comments

Comments

@yami12376
Copy link

yami12376 commented Oct 22, 2019

I have got following error:

[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.6:process-asciidoc (output-pdf) on project projectName: Execution output-pdf of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.6:process-asciidoc failed: (SyntaxError) C:/Users/username/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-beta.5/asciidoctorj-pdf-1.5.0-beta.5.jar!/gems/asciidoctor-pdf-1.5.0.beta.5/lib/asciidoctor-pdf/core_ext/numeric.rb:3: syntax error, unexpected kDO_BLOCK
[ERROR] Float.prepend (Module.new do

Maven:

<plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <version>1.5.6</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.asciidoctor</groupId>
                                <artifactId>asciidoctorj-pdf</artifactId>
                                <version>1.5.0-beta.5</version>
                            </dependency>
                        </dependencies>

works fine if I change

   <version>1.5.0-beta.5</version>

to

<version>1.5.0-alpha.15</version>

The same occurs on:

   <version>1.5.0-beta.6</version>

When I change version from 1.5.6 to 1.6.0 it does not immediately give error as in the examples above. Consider giving some matrix telling which version to use.

@mojavelinux
Copy link
Member

mojavelinux commented Oct 22, 2019 via email

@yami12376
Copy link
Author

These are the versions of JRuby:

[DEBUG] org.asciidoctor:asciidoctor-maven-plugin:jar:1.6.0:
[DEBUG] org.asciidoctor:asciidoctorj-pdf:jar:1.5.0-alpha.15:runtime
[DEBUG] org.jruby:jruby-complete:jar:9.2.6.0:compile

[DEBUG] org.asciidoctor:asciidoctorj-pdf:jar:1.5.0-alpha.15:compile
[DEBUG] org.asciidoctor:asciidoctorj:jar:1.5.5:runtime
[DEBUG] org.jruby:jruby-complete:jar:9.1.8.0:runtime

[DEBUG] org.asciidoctor:asciidoctorj:jar:1.6.2:compile
[DEBUG] org.asciidoctor:asciidoctorj-api:jar:1.6.2:compile
[DEBUG] org.jruby:jruby:jar:9.2.6.0:compile

[DEBUG] Included: org.asciidoctor:asciidoctor-maven-plugin:jar:1.5.6
[DEBUG] Included: org.asciidoctor:asciidoctorj-pdf:jar:1.5.0-beta.6
[DEBUG] Included: org.jruby:jruby-complete:jar:1.7.26

Caused by: org.jruby.exceptions.RaiseException: (SyntaxError) C:/Users/username/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-beta.6/asciidoctorj-pdf-1.5.0-beta.6.jar!/gems/asciidoctor-pdf-1.5.0.beta.6/lib/asciidoctor/pdf/ext/core/numeric.rb:3: syntax error, unexpected kDO_BLOCK
Float.prepend (Module.new do
^
at org.jruby.RubyKernel.require (org/jruby/RubyKernel.java:1040)
at RUBY.require (/C:/Users/username/.m2/repository/org/jruby/jruby-complete/1.7.26/jruby-complete-1.7.26.jar!

@mojavelinux
Copy link
Member

It appears you have multiple versions of Ruby on the classpath. Most concerning is JRuby 1.7.26, which is no longer supported. And that's likely why you're getting the error. You must at least be using JRuby 9.1.

@yami12376
Copy link
Author

The comment above was aggregating information and i was changing version in pom.xml.

@mojavelinux
Copy link
Member

mojavelinux commented Oct 23, 2019 via email

@mojavelinux
Copy link
Member

Here's a branch that shows that the example works:

asciidoctor/asciidoctor-maven-examples#88

It also works if I test it with these versions:

        <asciidoctor.maven.plugin.version>1.5.6</asciidoctor.maven.plugin.version>
<asciidoctorj.pdf.version>1.5.0-beta.6</asciidoctorj.pdf.version>
<asciidoctorj.version>1.5.8.1</asciidoctorj.version>
<jruby.version>9.2.8.0</jruby.version>

So I think your dependencies have disagreements. I'd need to see a full example to know more.

@abelsalgadoromeroWD
Copy link

Noted! I will upgrade all versions for all projects today. I started it, but kindlegen is giving me some headaches on this machine and I want to test all projects manually.I'll do when I get home later (in 9h).

Do you mind If I close this PR?

@mojavelinux
Copy link
Member

You can close the PR. I submitted merely as a reference for answering this issue.

@yami12376
Copy link
Author

yami12376 commented Oct 24, 2019

Ok, thanks. I am happy that version 1.6.0 works fine with 1.5.0-beta.6 in my case.
Also note that in the example you provided explicity:
<jruby.version>9.2.7.0</jruby.version>

Which i do not have anywhere in my project.
Are you sure that:
<asciidoctorj.pdf.version>1.5.0-beta.6</asciidoctorj.pdf.version> <asciidoctorj.version>2.1.0</asciidoctorj.version>

Does not provide JRuby?
In my plugin Depedency Anaylyzer i do not see conflict regarding JRuby in the component i use generating pdf with it.

I think that for example:

<groupId>org.asciidoctor</groupId> <artifactId>asciidoctorj-pdf</artifactId> <version>1.5.0-alpha.15</version>

Contains:

    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-complete</artifactId>
      <version>9.1.8.0</version>
      <scope>runtime</scope>
    </dependency>

That is JRuby or what?

If i would provide


        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-complete</artifactId>
            <version>9.2.8.0</version>
        </dependency>

Then i see conflict in my Depedency Analyzer with jruby-complete.

Probably in version 1.5.0-alpha.18 it is not inside anymore.

@abelsromero
Copy link
Member

Does not provide JRuby?

jruby-complete is provided by the maven plugin as a default, is not part of dependencies of asciidoctorj or asciidoctorj-pdf.
We try to use the latest stable version at the time of release unless some problem is found. So it is mostly always good to replace the provided version by the most recent one. In this case going from 9.2.7.0 to 9.2.8.0.

Then i see conflict in my Depedency Analyzer with jruby-complete.

I can't help here, but I assure you it is safe. Also, I recommend to use the latest maven plugin version as shown in the examples. It is a RC, but is perfectly stable.

@robertpanzer
Copy link
Member

Please reopen the ticket if the error still occurs with the latest versions of the asciidoctor-maven-plugin, asciidoctorj and asciidoctorj-pdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants