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

Target Java 8 in maven-javadoc-plugin #1531

Merged
merged 1 commit into from
Sep 29, 2022
Merged

Conversation

yrodiere
Copy link
Contributor

@yrodiere yrodiere commented Sep 28, 2022

To avoid errors related to modules.

Fixes #1528

It only makes sense, since the library itself targets Java 8 anyway, and the library's javadoc already links to JDK 8's javadoc (not JDK 11's).

The resulting javadoc does not seem to differ in any significant way; below is the result of a diff between the output with:

  • maven-javadoc-plugin 3.0.0 + <source>11</source>
  • maven-javadoc-plugin 3.4.1 + <release>8</release>
$ diff -I "Generated by javadoc" -r target/apidocs/ ~/tmp/github-api-apidocs-8
Binary files target/apidocs/member-search-index.zip and /home/yrodiere/tmp/github-api-apidocs-8/member-search-index.zip differ
diff -I 'Generated by javadoc' -r target/apidocs/org/kohsuke/github/GHPersonSet.html /home/yrodiere/tmp/github-api-apidocs-8/org/kohsuke/github/GHPersonSet.html
276c276
< <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#parallelStream()" title="class or interface in java.util" class="externalLink">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#removeIf(java.util.function.Predicate)" title="class or interface in java.util" class="externalLink">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#stream()" title="class or interface in java.util" class="externalLink">stream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#toArray(java.util.function.IntFunction)" title="class or interface in java.util" class="externalLink">toArray</a></code></li>
---
> <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#parallelStream()" title="class or interface in java.util" class="externalLink">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#removeIf(java.util.function.Predicate)" title="class or interface in java.util" class="externalLink">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#stream()" title="class or interface in java.util" class="externalLink">stream</a></code></li>
Binary files target/apidocs/package-search-index.zip and /home/yrodiere/tmp/github-api-apidocs-8/package-search-index.zip differ
Binary files target/apidocs/type-search-index.zip and /home/yrodiere/tmp/github-api-apidocs-8/type-search-index.zip differ

Now, you will ask: what about when we drop support for JDK 8? Well, I don't have an answer for that, but I hope the problematic dependencies (those with split packages) will be gone by then. If not, I'd say that's a problem for another day.

To avoid errors related to modules.

It only makes sense, since the library itself targets Java 8 anyway, and
the library's javadoc already links to JDK 8's javadoc (not JDK 11's).

The resulting javadoc does not seem to differ in any significant way;
below is the result of a diff between the output with:

* maven-javadoc-plugin 3.0.0 + <source>11</source>
* maven-javadoc-plugin 3.4.1 + <release>8</release>

```
$ diff -I "Generated by javadoc" -r target/apidocs/ ~/tmp/github-api-apidocs-8
Binary files target/apidocs/member-search-index.zip and /home/yrodiere/tmp/github-api-apidocs-8/member-search-index.zip differ
diff -I 'Generated by javadoc' -r target/apidocs/org/kohsuke/github/GHPersonSet.html /home/yrodiere/tmp/github-api-apidocs-8/org/kohsuke/github/GHPersonSet.html
276c276
< <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#parallelStream()" title="class or interface in java.util" class="externalLink">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#removeIf(java.util.function.Predicate)" title="class or interface in java.util" class="externalLink">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#stream()" title="class or interface in java.util" class="externalLink">stream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#toArray(java.util.function.IntFunction)" title="class or interface in java.util" class="externalLink">toArray</a></code></li>
---
> <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#parallelStream()" title="class or interface in java.util" class="externalLink">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#removeIf(java.util.function.Predicate)" title="class or interface in java.util" class="externalLink">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#stream()" title="class or interface in java.util" class="externalLink">stream</a></code></li>
Binary files target/apidocs/package-search-index.zip and /home/yrodiere/tmp/github-api-apidocs-8/package-search-index.zip differ
Binary files target/apidocs/type-search-index.zip and /home/yrodiere/tmp/github-api-apidocs-8/type-search-index.zip differ
```
@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Base: 79.27% // Head: 79.27% // No change to project coverage 👍

Coverage data is based on head (61a959b) compared to base (30ff8e6).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1531   +/-   ##
=========================================
  Coverage     79.27%   79.27%           
  Complexity     2137     2137           
=========================================
  Files           206      206           
  Lines          6562     6562           
  Branches        362      362           
=========================================
  Hits           5202     5202           
  Misses         1148     1148           
  Partials        212      212           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bitwiseman
Copy link
Member

It's strange, I thought I was seeing this even with the 8 value.
Did you run your test on JDK 17 with the 8 target?

@yrodiere
Copy link
Contributor Author

It's strange, I thought I was seeing this even with the 8 value. Did you run your test on JDK 17 with the 8 target?

I was using JDK 11 since tests don't seem to pass with JDK 17.

That being said, I just ran the build with -Prelease -DskipTests and JDK 17, and yes, this works fine as well (though the diff is larger for some reason, but it seems most changes are just related to the "NESTED" entry in the top menu).

I think the trick is using <release>8</release> and not <source>8</source>.

@bitwiseman bitwiseman merged commit 4bba968 into hub4j:main Sep 29, 2022
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.

Maven release fails during javadoc generation
2 participants