asciidoctor / asciidoctor-maven-plugin

A Maven plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
http://asciidoctor.org
Apache License 2.0
317 stars 122 forks source link

FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem #553

Closed arjantijms closed 9 months ago

arjantijms commented 3 years ago

What is this issue about?

Description

When I invoke maven asciidoctor with Java 16 or Java 17 then I get the output WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem;

[INFO] --- asciidoctor-maven-plugin:2.2.1:process-asciidoc (asciidoc-to-html) @ security-spec ---
[INFO] sourceDirectory /security-api/spec/src/docs/asciidoc does not exist
[INFO] sourceDirectory /security-api/spec/src/asciidoc does not exist
2021-08-24T12:56:50.199+02:00 [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED' to enable.
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.

Environment information

abelsromero commented 3 years ago

It's a known thing in Asciidoctorj https://github.com/asciidoctor/asciidoctorj/issues/1035 but builds work (at least for 16), so priority is not high . The linked issue has a PR with some "unconclusive" work :sweat_smile:, if you have some insight, help would me much appreciated.

arjantijms commented 3 years ago

Thanks for the pointer, if/when I have some time left I could certainly try to look into it ;)

khmarbaise commented 2 years ago

Stumbled upon the same WARNing:

[INFO] --- asciidoctor-maven-plugin:2.2.1:process-asciidoc (output-html) @ itf-documentation ---
132s
682 2021-09-27T20:48:23.920Z [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
134s
683 Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED' to enable.
134s
684 [INFO] Using 'UTF-8' encoding to copy filtered resources.

Environment: Drone Build, Open JDK 17 Maven 3.8.2 https://cloud.drone.io/khmarbaise/maven-it-extension/229/1/3

abelsromero commented 2 years ago

Thanks for the reminder, now that Java 17 is out we definetly need to have a look at at it.

khmarbaise commented 1 year ago
[INFO] --- asciidoctor-maven-plugin:2.2.3:process-asciidoc (output-html) @ itf-documentation ---
2023-03-25T17:23:33.138+01:00 [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED' to enable.
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 0 resource

Current environment:

Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /Users/khm/tools/maven
Java version: 19.0.2, vendor: Eclipse Adoptium, runtime: /Users/khm/.sdkman/candidates/java/19.0.2-tem
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "12.4", arch: "aarch64", family: "mac"
alexandrutata commented 1 year ago

Any updates on this? I have the same issue :) Thank you!

abelsromero commented 1 year ago

Not yet, given it's a warning (for now) it's not been prioritized.

abelsromero commented 1 year ago

Just an update, it all points to not being possible to do anything in our side, in AsciidoctorJ and Gradle plugins the solutions are to add required flags to the environment.

rimuln commented 1 year ago

What is current state? windows 11 maven 3.9.2 AdoptOpenJdk 17.0.7-7 asciidoctor-maven-plugin 2.2.4 asciidoctor-pdf 2.3.7 asciidoctorj 2.5.10 jruby 9.4.3.0

I'm still getting this warning in maven output

[INFO] --- asciidoctor:2.2.4:process-asciidoc (output-pdf) @ model-documentation ---
2023-07-04T13:29:35.045+02:00 [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED' to enable.
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 11 resources
[INFO] Converted <removed part of path>\src\main\asciidoc\index.adoc

I tried to read all linked issued in asciidoctor jruby etc. and not sure about the current state. I saw some merged commits in asciidoctor but it was in some txt file for linux? So still no solution?

abelsromero commented 1 year ago

I tried to read all linked issued in asciidoctor jruby etc. and not sure about the current state. I saw some merged commits in asciidoctor but it was in some txt file for linux?

I assume you mean the fixes in the AsciidoctorJ cli. We added the configuration to add the warning suppressions, but that cannot be applied here since we don't control the OS process launching the maven plugin. The equivalent fix would need to be applied as a global Maven configuration, and we don't have control over that.

So still no solution?

Simply, there's no solution to apply. JRuby needs certain components of the JDK that are considered "internal" and the Java runtime warns about that. You can read more here https://github.com/jruby/jruby/issues/6721. Iirc, your can use MAVEN_OPTS to add the suppressions, but that will apply to all maven builds.

khmarbaise commented 10 months ago

So based on the original dependencies of the plugin in version 2.2.4 using the following:

        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <version>2.2.4</version>
          <dependencies>
            <dependency>
              <groupId>org.jruby</groupId>
              <artifactId>jruby</artifactId>
              <version>9.4.5.0</version>
            </dependency>
...

fixed the issue. If you use version 9.4.4.0 of jruby the WARNING is still there. Only newest version fixed the issue. This works even with JDK21.

abelsromero commented 9 months ago

Thanks @khmarbaise ! I confirmed it, I'll bump version here and in AsciidoctorJ today :tada:

kriegaex commented 8 months ago

It seems as if there was no release since 2.2.4 on 2023-05-29. The JRuby dependency bump suggested by @khmarbaise works, but it would be nice to get rid of it in favour of a new maintenance release. This issue has been open for 2.5 years. Thank you.

abelsromero commented 8 months ago

but it would be nice to get rid of it in favour of a new maintenance release

Great idea! I should have some time between today and tomorrow.

abelsromero commented 8 months ago

All is ready, tomorrow I'll do 2.2.5 release.

kriegaex commented 8 months ago

Thank you so much. I see, that a couple of hours ago you added a release to GitHub, but on Maven Central it has not surfaced yet, which is unusual.

https://repo1.maven.org/maven2/org/asciidoctor/asciidoctor-maven-plugin/2.2.5/ yields 404.

Normally, it appears in a matter of minutes. Or did you forget to deploy or promote the deployment?

abelsromero commented 8 months ago

Forgot one last button, thanks! That's why I want to automate this and get releases more often.

kriegaex commented 8 months ago

Looking good in 2.2.5, the warnings are gone. Thank you very much. 😊🎈