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

Going to jdk 17 21 #124

Merged
merged 21 commits into from
Apr 6, 2024
Merged

Conversation

dakusui
Copy link
Contributor

@dakusui dakusui commented Mar 27, 2024

This is a pull request for your information.
So far, I made sure that this works with Java17 and Java21.
The rendered JavaDoc by the modified AsciiDoclet with Java 21 is found here.

https://dakusui.github.io/asciidoclet-2/

I am now removing unnecessary changes from the PR for your convenience.

@dakusui
Copy link
Contributor Author

dakusui commented Mar 27, 2024

Remaining Issue (1):
Following warnings are printed during mvn compile (Java 21.0.2).

A

[INFO] --- maven-compiler-plugin:3.12.1:compile (default-compile) @ asciidoclet ---
[WARNING] ****************************************************************************************************************************************************************************
[WARNING] * Required filename-based automodules detected: [asciidoctorj-2.5.12.jar, asciidoctorj-api-2.5.12.jar]. Please don't publish this project to a public artifact repository! *
[WARNING] ****************************************************************************************************************************************************************************

B

[WARNING] system modules path not set in conjunction with -source 17

C

[INFO] /home/hiroshi/Documents/github/asciidoctor/asciidoclet/src/main/java/org/asciidoctor/asciidoclet/AsciidoctorConverter.java: Some input files use or override a deprecated API.
[INFO] /home/hiroshi/Documents/github/asciidoctor/asciidoclet/src/main/java/org/asciidoctor/asciidoclet/AsciidoctorConverter.java: Recompile with -Xlint:deprecation for details.

@dakusui
Copy link
Contributor Author

dakusui commented Mar 27, 2024

Remaining Issue (2):
Following warnings are printed during mvn package (mvn-javadoc-plugin; Java 21.0.2)

[INFO] --- maven-javadoc-plugin:3.6.3:jar (attach-javadocs) @ asciidoclet ---
[INFO] No previous run data found, generating javadoc.
[WARNING] Javadoc Warnings
[WARNING] Mar 28, 2024 7:59:27 AM uri:classloader:/gems/asciidoctor-2.0.22/lib/asciidoctor/parser.rb parse
[WARNING] WARNING: README.adoc: line 115: section title out of sequence: expected level 1, got level 2
[WARNING] Mar 28, 2024 7:59:27 AM uri:classloader:/gems/asciidoctor-2.0.22/lib/asciidoctor/parser.rb parse
[WARNING] WARNING: README.adoc: line 152: section title out of sequence: expected level 1, got level 2
[WARNING] Mar 28, 2024 7:59:27 AM uri:classloader:/gems/asciidoctor-2.0.22/lib/asciidoctor/parser.rb parse
[WARNING] WARNING: README.adoc: line 182: section title out of sequence: expected level 1, got level 2
[WARNING] Mar 28, 2024 7:59:27 AM uri:classloader:/gems/asciidoctor-2.0.22/lib/asciidoctor/parser.rb parse
[WARNING] WARNING: README.adoc: line 203: section title out of sequence: expected level 1, got level 2
[WARNING] Mar 28, 2024 7:59:28 AM uri:classloader:/gems/asciidoctor-2.0.22/lib/asciidoctor/reader.rb resolve_include_path
[WARNING] WARNING: include file has illegal reference to ancestor of jail; recovering automatically
[WARNING] Mar 28, 2024 7:59:28 AM uri:classloader:/gems/asciidoctor-2.0.22/lib/asciidoctor/reader.rb resolve_include_path
[WARNING] WARNING: include file has illegal reference to ancestor of jail; recovering automatically
[WARNING] A non-LazyDocCommentTable instance is passed. Ignoring.
[WARNING] 1 warning

@dakusui
Copy link
Contributor Author

dakusui commented Mar 27, 2024

Remaining Issue (3):
Following warnings are printed during mvn package (mvn-shade-plugin; Java 21.0.2)

[INFO] Dependency-reduced POM written at: /home/hiroshi/Documents/github/asciidoctor/asciidoclet/dependency-reduced-pom.xml
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] asciidoclet-2.0.0-SNAPSHOT.jar, asciidoctorj-2.5.12.jar, asciidoctorj-api-2.5.12.jar, asm-9.2.jar, asm-analysis-9.2.jar, asm-commons-9.2.jar, asm-tree-9.2.jar, asm-util-9.2.jar, backport9-1.13.jar, dirgra-0.3.jar, invokebinder-1.13.jar, jcodings-1.0.58.jar, jcommander-1.82.jar, jffi-1.3.13-native.jar, jffi-1.3.13.jar, jitescript-0.4.1.jar, jnr-a64asm-1.0.0.jar, jnr-constants-0.10.4.jar, jnr-enxio-0.32.17.jar, jnr-ffi-2.2.16.jar, jnr-netdb-1.2.0.jar, jnr-posix-3.1.19.jar, jnr-unixsocket-0.38.22.jar, jnr-x86asm-1.0.2.jar, joda-time-2.12.5.jar, joni-2.2.1.jar, jruby-9.4.6.0.jar, jruby-base-9.4.6.0.jar, jruby-stdlib-9.4.6.0.jar, jzlib-1.1.5.jar, options-1.6.jar define 1 overlapping resource: 
[WARNING]   - META-INF/MANIFEST.MF
[WARNING] jruby-9.4.6.0.jar, jruby-stdlib-9.4.6.0.jar define 4 overlapping resources: 
[WARNING]   - META-INF/BSDL
[WARNING]   - META-INF/COPYING
[WARNING]   - META-INF/LEGAL
[WARNING]   - META-INF/LICENSE.RUBY
[WARNING] maven-shade-plugin has detected that some files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the file is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See https://maven.apache.org/plugins/maven-shade-plugin/

pom.xml Outdated Show resolved Hide resolved
… method.

Also, make pom.xml use JDK 11 for compilation and testing since it seems working with JDK21 project.
@dakusui
Copy link
Contributor Author

dakusui commented Mar 27, 2024

I reverted a few changes in pom.xml since the JDK11 compiled version may work with JDK17 and JDK21.
I am still checking.

@abelsromero
Copy link
Member

I am still checking.

If you prefer, mark the PR as a draft while still making changes. And thanks a lot for the effort.

@dakusui dakusui marked this pull request as draft March 28, 2024 21:44
@dakusui
Copy link
Contributor Author

dakusui commented Mar 29, 2024

I believe the compiled binary by JDK11 works under JDK21.
The rendered result is found here: https://dakusui.github.io/doclet-exercise/en/apidocs/index.html

This is generated for this repo: https://github.com/dakusui/doclet-exercise

@dakusui dakusui marked this pull request as ready for review March 29, 2024 01:54
@dakusui dakusui changed the title FYI: Going to jdk 17 21 Going to jdk 17 21 Mar 29, 2024
abelsromero
abelsromero previously approved these changes Apr 4, 2024
Copy link
Member

@abelsromero abelsromero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the only important thing is fixing the docType configuration.
It's great you could make it work on Java 11 too, less branches and releases then 🎉

Thanks again a lot!

@abelsromero
Copy link
Member

@dakusui About the other comments you mentioned:


Following warnings are printed during mvn compile (Java 21.0.2).

A

It's OK: this warning is normal because AsciidoctoJ does not define Java module. This should be fixed upstream.

B

Its OK.
It comes from the <source> in the maven-compiler-plugin. In theory for Java > 11 we should use <release> but that prevents the use of opens that we need. Truth be told, we are really pushing things hard with all the opens and exports, so warnings are expected.

C

I see you saw the issues 👏 . The code was still using methods labeled as @deprecated in AscidoctorJ.


Remaining Issue (2):
Following warnings are printed during mvn package (mvn-javadoc-plugin; Java 21.0.2)

I don't see it in the current commit, Contratulations on fixing it! 🎉


Remaining Issue (3):

Following warnings are printed during mvn package (mvn-shade-plugin; Java 21.0.2)

Don't worry, this can be addressed separately #120.
Ideally, we should not need to publish a fatJar. A fatJar includes AsciidoctorJ which means we should need to do a release every time there's a new AsciidoctorJ.
Doing a test without a fatJat, I saw that the jadavoc-plugin detects and downloads dependencies like AsciidoctorJ, but 🤷 for whatever reason does not add it to the classpath.

Performance improvement of "processComment" in LazyDocCommentTableProcessor.
@abelsromero
Copy link
Member

abelsromero commented Apr 6, 2024

My end-to-end test on Java 21 is generating a weird header. Do you see the same?

image

If you prefer we can merge as Java 17 works fine and work on java 21 in another PR. The build works fine, I assume it's a styles thing 🤞

EDIT: Looking a how javadocs are build for theasciidoctor-maven-plugin I see the white element is a new button and the other text is a new div and both by default apply display:none; and are not present when building with Java 17.

Adding the lines below the stylesheet17.css worked, given these elements are new, I think we can leave them with a comment. No need to have a full new file for Java 21.

ul.sub-nav-list-small {
    display: none;
}
button#navbar-toggle-button {
    display:none;
}

@dakusui
Copy link
Contributor Author

dakusui commented Apr 6, 2024

Actually, I didn't.
Mine shows this, which is less weird than yours.

Screenshot from 2024-04-07 05-25-51

After adding the suggested change, it became like this:

Screenshot from 2024-04-07 05-45-32

@abelsromero abelsromero self-requested a review April 6, 2024 21:13
@abelsromero abelsromero merged commit fbd8850 into asciidoctor:main Apr 6, 2024
3 checks passed
@dakusui dakusui deleted the going-to-jdk-17-21 branch April 10, 2024 00:51
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 this pull request may close these issues.

None yet

2 participants