epics-base / jca

Java Channel Access client API
https://www.javadoc.io/doc/org.epics/jca/latest/index.html
Other
8 stars 14 forks source link

Build error related to javadoc with Maven 3.9.1 and JDK 20 #79

Open kasemir opened 3 months ago

kasemir commented 3 months ago

Using Maven 3.9.1 and OpenJDK Runtime Environment (build 20+36-2344), I get this from mvn -DskipTests clean install:

[INFO] --- javadoc:2.10.4:jar (attach-javadocs) @ jca ---
[WARNING] Error injecting: org.apache.maven.plugin.javadoc.JavadocJar
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/ErrorInjectingConstructor]: ExceptionInInitializerError
  at JavadocJar.<init>(JavadocJar.java:54)
  while locating JavadocJar

Learn more:
  https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR

1 error

======================
Full classname legend:
======================
JavadocJar:                  "org.apache.maven.plugin.javadoc.JavadocJar"
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.792 s
[INFO] Finished at: 2024-06-14T12:24:27-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar (attach-javadocs) on project jca: Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar failed: Unable to load the mojo 'jar' in the plugin 'org.apache.maven.plugins:maven-javadoc-plugin:2.10.4' 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.10.4
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/ky9/.m2/repository/org/apache/maven/plugins/maven-javadoc-plugin/2.10.4/maven-javadoc-plugin-2.10.4.jar

As a workaround, just skipping the javadoc step with mvn -DskipTests -Dmaven.javadoc.skip=true clean install or removing the following section from the pom.xml does not suffice, but doing both (add maven.javadoc.skip AND remove that pom section) allow the build to complete.

            <!-- Required add sources to deployment -->
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <configuration>
                    <additionalparam>${javadoc.doclint.none}</additionalparam>
                    <source>1.8</source>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>