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

Upgrade to 9.2.10.0 breaks project using asciidoctor-maven-plugin #6082

Closed
pzygielo opened this issue Feb 19, 2020 · 13 comments · Fixed by #6084
Closed

Upgrade to 9.2.10.0 breaks project using asciidoctor-maven-plugin #6082

pzygielo opened this issue Feb 19, 2020 · 13 comments · Fixed by #6084

Comments

@pzygielo
Copy link
Contributor

pzygielo commented Feb 19, 2020

Environment Information

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc): 9.2.10.0, maven
  • Operating system and platform (e.g. uname -a): Linux

Other relevant info you may wish to add:

Expected Behavior

  • Describe your expectation of how JRuby should behave, perhaps by showing how CRuby/MRI behaves.

Smooth upgrade from JRuby 9.2.9.0 to 9.2.10.0.

  • Provide an executable Ruby script or a link to an example repository.

Actual Behavior

  • Describe or show the actual behavior.

Not 100% sure if this is JRuby's fault, but project worked with 9.2.9.0, and only change being upgrade to 9.2.10.0 causes this:

[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc (output-pdf) on project: Execution output-pdf of goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc failed: (LoadError) no such file to load -- asciidoctor-pdf -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc (output-pdf) on project: Execution output-pdf of goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc failed: (LoadError) no such file to load -- asciidoctor-pdf
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution output-pdf of goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc failed: (LoadError) no such file to load -- asciidoctor-pdf
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-pdf
    at org.jruby.RubyKernel.require (org/jruby/RubyKernel.java:974)
    at RUBY.require (uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54)
    at RUBY.<main> (<script>:1)

with plugin configured like this

            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>2.0.0-RC.1</version><!-- using 1.6.0 doesn't help -->
                <executions>
                    <execution>
                        <id>output-pdf</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>1.5.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby-complete</artifactId>
                        <version>9.2.10.0</version>
                    </dependency>
                </dependencies>
            </plugin>
@pzygielo
Copy link
Contributor Author

IF it is a change in JRuby, it might happen after 9.2.10.0-20200214.161712-78, as this snapshot works fine, while 9.2.10.0-20200214.210609-79 is the first to fail.

@deivid-rodriguez
Copy link
Contributor

This sounds like could be related to the rubygems upgrade? If you downgrade rubygems with gem update --system 2.7.10, does the problem still happen?

@pzygielo
Copy link
Contributor Author

This sounds like could be related to the rubygems upgrade? If you downgrade rubygems with gem update --system 2.7.10, does the problem still happen?

I'm not using gems directly, only via maven build.
On clean, brand new environment, with jruby-complete 9.2.10 it happens.
On clean, brand new environment, with jruby-complete 9.2.9 it doesn't.

@deivid-rodriguez
Copy link
Contributor

Oh, I see. Thanks for the information and also for the bisecting to the snapshot level, which seems to closely point to the rubygems upgrade.

@headius
Copy link
Member

headius commented Feb 19, 2020

Drat... we did have a couple minor issues with RubyGems loading gem specifications out of a jar, but I didn't think it would affect any real-world code. We will look at getting this fixed, but it may require upstreaming changes to RubyGems proper.

@headius
Copy link
Member

headius commented Feb 19, 2020

Can you provide a small repository or example that we could use to reproduce this issue locally? Ideally it would be something we can turn into a CI smoke test so this doesn't break again.

@headius
Copy link
Member

headius commented Feb 19, 2020

See #6060 for the issue we found while upgrading RubyGems.

@pzygielo
Copy link
Contributor Author

Can you provide a small repository or example that we could use to reproduce this issue locally? Ideally it would be something we can turn into a CI smoke test so this doesn't break again.

https://github.com/pzrep/jruby-9.2.10-asciidoctor-pdf

@enebo enebo added this to the JRuby 9.2.11.0 milestone Feb 19, 2020
headius added a commit to headius/jruby that referenced this issue Feb 19, 2020
Dir.glob was treating any passed-in `base` path as a normal file
path, which cause it to treat URIs as a relative path. The logic
then proceeded to prepend the cwd to this URI, producing a
nonsense path.

This patch uses File.expand_path logic to acquire the base path,
which keeps it a URI and allows the rest of glob to handle it
as if the glob and base were expanded before calling Dir.glob.

The change means that the two following Dir.glob calls work the
same, fixing the issues discovered in jruby#6060. It will very likely
also fix the issues reported in jruby#6082 and jruby#6083.

Fixes jruby#6060
Fixes jruby#6082
Fixes jruby#6083
@headius
Copy link
Member

headius commented Feb 19, 2020

I have pushed a likely fix in #6084. Will test locally, but if you can try a HEAD build from the jruby-9.2 branch it would provide more coverage.

@pzygielo
Copy link
Contributor Author

I have pushed a likely fix in #6084. Will test locally, but if you can try a HEAD build from the jruby-9.2 branch it would provide more coverage.

Will try on first chance and share my results.

@headius
Copy link
Member

headius commented Feb 19, 2020

What do I do with that repo to reproduce? I tried package and generate-resources and it does not fail.

@headius
Copy link
Member

headius commented Feb 19, 2020

Oh nevermind, I see the repo had 9.2.9.0 configured. Changing to 9.2.10.0 shows the error and 9.2.11.0-SNAPSHOT works correctly. 🎉

@pzygielo
Copy link
Contributor Author

What do I do with that repo to reproduce? I tried package and generate-resources and it does not fail.

There is also branch dependabot/maven/org.jruby-jruby-complete-9.2.10.0 with JRuby upgraded and failure attached.

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

Successfully merging a pull request may close this issue.

4 participants