Skip to content

maven-javadoc-plugin is not skipped in Java 11 #844

@algomaster99

Description

@algomaster99

The version of Java 11 we use seems to ignore the presence of -Dmaven.javadoc.skip=true. It seems to be a popular bug.

There's a serious problem in the ecosystem with javadoc + maven + jdk 11

I tried looking around to add more flags to skip it but none of them work. My suggestion is that if we fallback to JDK 11, let's fallback to the highest patch release for it which is 11.0.28. I confirmed that replacing the JDK URL works for this case.

#syntax=docker/dockerfile:1.10
FROM docker.io/library/debian:trixie-20250203-slim
RUN <<'EOF'
 set -eux
 apt update
 apt install -y git wget maven
EOF
RUN <<'EOF'
 set -eux
 mkdir -p /src && cd /src
 git clone https://github.com/westwong/westdao .
 git checkout --force '451a7cea9df7c9ff4e45b684577a7c9d3cd10bb6'
 mkdir -p /opt/jdk
 wget -q -O - "https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz" | tar -xzf - --strip-components=1 -C /opt/jdk
EOF
RUN cat <<'EOF' >/build
 set -eux
 export JAVA_HOME=/opt/jdk
 export PATH=$JAVA_HOME/bin:$PATH
 mvn clean package -DskipTests --batch-mode -f WestDaoCore -Dmaven.javadoc.skip=true
 chmod +444 /src/WestDaoCore/target/westdao-core-1.2.8.jar
 mkdir -p /out && cp /src/WestDaoCore/target/westdao-core-1.2.8.jar /out/
EOF
WORKDIR "/src"
ENTRYPOINT ["/bin/sh","/build"]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project westdao-core: Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar failed: Unable to load the mojo 'jar' in the plugin 'org.apache.maven.plugins:maven-javadoc-plugin:2.9.1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-javadoc-plugin:2.9.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions