prometheus / client_java

Prometheus instrumentation library for JVM applications

Home Page:http://prometheus.github.io/client_java/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Javadoc command fails on Github Actions

fstab opened this issue · comments

#874 broke the Javadoc command. Github actions aborts with the following error:

Error:  Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.0:javadoc (default-cli) on project prometheus-metrics-model: An error has occurred in Javadoc report generation: 
Error:  Exit code: 2 - Loading source files for package io.prometheus.metrics.model.registry...
Error: [ERROR] error: No source files for package io.prometheus.metrics.model.registry
Error: [ERROR] 1 error

This can be reproduced locally:

./mvnw clean install
./mvnw compile javadoc:javadoc javadoc:aggregate

I'll temporarily remove the maven-bundle-plugin configuration.

@solomax do you see what's wrong?

Hello @fstab,

to fix this issue you need to add <source>8</source> to configuration section of maven-javadoc-plugin

so it will look like this:

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <linksource>true</linksource>
                    <noqualifier>all</noqualifier>
                    <show>public</show>
                    <skippedModules>benchmarks,examples,integration-tests,integration_tests,,simpleclient,simpleclient_bom,simpleclient_caffeine,simpleclient_common,simpleclient_dropwizard,simpleclient_graphite_bridge,simpleclient_guava,simpleclient_hibernate,simpleclient_hotspot,simpleclient_httpserver,simpleclient_jetty,simpleclient_jetty_jdk8,simpleclient_log4j,simpleclient_log4j2,simpleclient_logback,simpleclient_pushgateway,simpleclient_servlet,simpleclient_servlet_common,simpleclient_servlet_jakarta,simpleclient_spring_boot,simpleclient_spring_web,simpleclient_tracer,simpleclient_vertx,simpleclient_vertx4</skippedModules>
                    <excludePackageNames>io.prometheus.metrics.expositionformats.generated.*</excludePackageNames>
                </configuration>
            </plugin>

Thanks @solomax. I found out something weird: If I call

./mvnw clean compile javadoc:javadoc javadoc:aggregate

instead of

./mvnw compile javadoc:javadoc javadoc:aggregate

it works. No idea why, and why this only makes a difference when the automatic module name is enabled. Tbh this looks like a bug in Maven to me.

Anyway, thanks, it works again.

Hello @fstab,
With javadoc source set to 8 initial command works for me :)
Java source and target versions are set to be 8 for compiler plugin
So I guess there is nothing wrong in setting it to 8 for javadoc :)