question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maven release fails during javadoc generation

See original GitHub issue
[INFO] [ERROR] error: module okhttp3.urlconnection reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module okio reads package okhttp3 from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module okio reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module org.kohsuke.github.api reads package okhttp3 from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module org.kohsuke.github.api reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module okhttp3 reads package okhttp3 from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module okhttp3 reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module com.github.spotbugs.annotations reads package okhttp3 from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module com.github.spotbugs.annotations reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module org.apache.commons.lang3 reads package okhttp3 from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module org.apache.commons.lang3 reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module org.apache.commons.io reads package okhttp3 from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: module org.apache.commons.io reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: the unnamed module reads package okhttp3 from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR] error: the unnamed module reads package okhttp3.internal from both okhttp3 and okhttp3.urlconnection
[INFO] [ERROR]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Sep 27, 2022

I had a look this morning and I couldn’t find any way to easily avoid these errors.

Tried a ton of javadoc options as I was hoping there could be an option to limit the module checks but the problem seems to be with how the maven-javadoc-plugin includes all the artifacts in the module path:

--add-modules
ALL-MODULE-PATH
--module-path
'/home/gsmet/.m2/repository/commons-io/commons-io/2.8.0/commons-io-2.8.0.jar:/data/home/gsmet/git/github-api/target/github-api-1.314-SNAPSHOT.jar:/home/gsmet/.m2/repository/com/squareup/okhttp3/okhttp-urlconnection/3.12.3/okhttp-urlconnection-3.12.3.jar:/home/gsmet/.m2/repository/com/squareup/okio/okio/2.10.0/okio-2.10.0.jar:/home/gsmet/.m2/repository/com/squareup/okhttp3/okhttp/4.9.2/okhttp-4.9.2.jar:/home/gsmet/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.3/jackson-databind-2.13.3.jar:/home/gsmet/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.4.20/kotlin-stdlib-1.4.20.jar:/home/gsmet/.m2/repository/com/github/spotbugs/spotbugs-annotations/4.7.1/spotbugs-annotations-4.7.1.jar:/home/gsmet/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.3/jackson-core-2.13.3.jar:/home/gsmet/.m2/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar:/home/gsmet/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.3/jackson-annotations-2.13.3.jar'
--patch-module
org.kohsuke.github.api='/data/home/gsmet/git/github-api/src/main/java:/data/home/gsmet/git/github-api/target/generated-sources/annotations:/home/gsmet/.m2/repository/com/infradna/tool/bridge-method-annotation/1.23/bridge-method-annotation-1.23.jar:/home/gsmet/.m2/repository/org/jenkins-ci/annotation-indexer/1.15/annotation-indexer-1.15.jar:/home/gsmet/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar:/home/gsmet/.m2/repository/io/jsonwebtoken/jjwt-api/0.11.5/jjwt-api-0.11.5.jar:/home/gsmet/.m2/repository/io/jsonwebtoken/jjwt-impl/0.11.5/jjwt-impl-0.11.5.jar:/home/gsmet/.m2/repository/io/jsonwebtoken/jjwt-jackson/0.11.5/jjwt-jackson-0.11.5.jar:/home/gsmet/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/home/gsmet/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.20/kotlin-stdlib-common-1.4.20.jar'

There’s no way to tweak this module path and, if there’s a way to add a dependency to the Javadoc classpath, there’s no way to exclude one.

I wonder if actually providing a module-info configuration could avoid that. From what I can see from the source of the plugin, if you have one, the maven-javadoc-plugin doesn’t build the module path by itself.

Now I’m not sure it’s doable with some of the dependencies probably not exposing a module name. And even if so, the module system could very well do the exact same checks even in this case.

I’m not very familiar with JPMS and I’d like to ask Yoann to have a look but he’s on sick leave today. We will let you know about our findings.

0reactions
bitwisemancommented, Sep 27, 2022

I worked around this finally by rolling back to a maven-javadoc-plugin v3.0.0 .

This reported 100+ instances of:

[INFO] [WARNING] javadoc: warning - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.

But it didn’t fail. That’s bad, but it let me get the release published.
I’ve rolled forward to v3.4.1 in main again. If I have to downgrade to get another release out, I can do that.

But I’d really like help getting a actual solution to this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

maven release:perform failing to even try to generate javadoc ...
Since moving to Java 11 quite a while ago now, the maven release plugin fails to generate javadoc alongside the built artifact.
Read more >
Disable the Maven Javadoc Plugin - Baeldung
In this quick tutorial, we'll take a look at how to disable the Javadoc generation in Maven builds temporarily. 2. Introduction to the...
Read more >
maven-javadoc-plugin 3.2.0 breaks release #1145 - GitHub
I was repeatedly unable to successfully execute mvn release:perform with the latest version of the javadoc plugin. Rolling back to 3.1.1 caused no...
Read more >
Getting rid of javadoc error during releasing with maven
During my work I faced with a bit annoying error. Formerly I used Maven Release plugin several times to perform new releases from...
Read more >
Release Plugin-Errors - Google Groups
I have developed one plugin and submitted in the github repository,the ... [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found