prometheus / client_java

Prometheus instrumentation library for JVM applications
http://prometheus.github.io/client_java/
Apache License 2.0
2.15k stars 783 forks source link

Broken build (Source option 6 is no longer supported. Use 7 or later.) #824

Open hendrikebbers opened 1 year ago

hendrikebbers commented 1 year ago

When I just call ./mvnw verify in the repo the build ends with the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project simpleclient_tracer_common: Compilation failure: Compilation failure: 
[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.

Full build log

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for io.prometheus:it_exemplars_otel_agent:jar:0.16.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ line 76, column 15
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Prometheus Java Suite                                              [pom]
[INFO] Prometheus Java Span Context Supplier - Parent                     [pom]
[INFO] Prometheus Java Span Context Supplier - Common                  [bundle]
[INFO] Prometheus Java Span Context Supplier - OpenTelemetry           [bundle]
[INFO] Prometheus Java Span Context Supplier - OpenTelemetry Agent     [bundle]
[INFO] Prometheus Java Simpleclient                                    [bundle]
[INFO] Prometheus Java Simpleclient Common                             [bundle]
[INFO] Prometheus Java Simpleclient Caffeine                           [bundle]
[INFO] Prometheus Java Simpleclient Dropwizard                         [bundle]
[INFO] Prometheus Java Simpleclient Graphite Bridge                    [bundle]
[INFO] Prometheus Java Simpleclient Hibernate                          [bundle]
[INFO] Prometheus Java Simpleclient guava                              [bundle]
[INFO] Prometheus Java Simpleclient Servlet - Common                   [bundle]
[INFO] Prometheus Java Simpleclient Servlet - Javax                    [bundle]
[INFO] Prometheus Java Simpleclient Hotspot                            [bundle]
[INFO] Prometheus Java Simpleclient Httpserver                         [bundle]
[INFO] Prometheus Java Simpleclient log4j                              [bundle]
[INFO] Prometheus Java Simpleclient log4j2                             [bundle]
[INFO] Prometheus Java Simpleclient logback                            [bundle]
[INFO] Prometheus Java Simpleclient Pushgateway                        [bundle]
[INFO] Prometheus Java Simpleclient Servlet - Jakarta                  [bundle]
[INFO] Prometheus Java Simpleclient Spring Metrics                     [bundle]
[INFO] Prometheus Java Simpleclient Spring Boot Metric                 [bundle]
[INFO] Prometheus Java Simpleclient Jetty                              [bundle]
[INFO] Prometheus Java Simpleclient Jetty JDK 8                        [bundle]
[INFO] Prometheus Java Simpleclient Vert.x 3                           [bundle]
[INFO] Prometheus Java Simpleclient Vert.x 4                           [bundle]
[INFO] Prometheus Java Simpleclient BOM                                   [pom]
[INFO] Prometheus Java Client Benchmarks                                  [jar]
[INFO] Prometheus Java Suit - Integration Tests                           [pom]
[INFO] Integration Tests - Common Utilities                               [jar]
[INFO] Integration Tests - Exemplars with OpenTelemetry                   [jar]
[INFO] Integration Tests - Exemplars with the OpenTelemetry Agent         [jar]
[INFO] Integration Tests - Java Versions                                  [jar]
[INFO] Integration Tests - Servlet Jakarta Exporter web.xml               [war]
[INFO] Integration Tests - Pushgateway                                    [jar]
[INFO] Integration Tests - log4j2                                         [jar]
[INFO] 
[INFO] ------------------------< io.prometheus:parent >------------------------
[INFO] Building Prometheus Java Suite 0.16.1-SNAPSHOT                    [1/37]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-plugin-versions) @ parent ---
[INFO] 
[INFO] -----------------< io.prometheus:simpleclient_tracer >------------------
[INFO] Building Prometheus Java Span Context Supplier - Parent 0.16.1-SNAPSHOT [2/37]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-plugin-versions) @ simpleclient_tracer ---
[INFO] 
[INFO] --------------< io.prometheus:simpleclient_tracer_common >--------------
[INFO] Building Prometheus Java Span Context Supplier - Common 0.16.1-SNAPSHOT [3/37]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-plugin-versions) @ simpleclient_tracer_common ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ simpleclient_tracer_common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/hendrikebbers/git/prometheus_client_java/simpleclient_tracer/simpleclient_tracer_common/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ simpleclient_tracer_common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/hendrikebbers/git/prometheus_client_java/simpleclient_tracer/simpleclient_tracer_common/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.
[INFO] 2 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Prometheus Java Suite 0.16.1-SNAPSHOT:
[INFO] 
[INFO] Prometheus Java Suite .............................. SUCCESS [  0.636 s]
[INFO] Prometheus Java Span Context Supplier - Parent ..... SUCCESS [  0.016 s]
[INFO] Prometheus Java Span Context Supplier - Common ..... FAILURE [  0.798 s]
[INFO] Prometheus Java Span Context Supplier - OpenTelemetry SKIPPED
[INFO] Prometheus Java Span Context Supplier - OpenTelemetry Agent SKIPPED
[INFO] Prometheus Java Simpleclient ....................... SKIPPED
[INFO] Prometheus Java Simpleclient Common ................ SKIPPED
[INFO] Prometheus Java Simpleclient Caffeine .............. SKIPPED
[INFO] Prometheus Java Simpleclient Dropwizard ............ SKIPPED
[INFO] Prometheus Java Simpleclient Graphite Bridge ....... SKIPPED
[INFO] Prometheus Java Simpleclient Hibernate ............. SKIPPED
[INFO] Prometheus Java Simpleclient guava ................. SKIPPED
[INFO] Prometheus Java Simpleclient Servlet - Common ...... SKIPPED
[INFO] Prometheus Java Simpleclient Servlet - Javax ....... SKIPPED
[INFO] Prometheus Java Simpleclient Hotspot ............... SKIPPED
[INFO] Prometheus Java Simpleclient Httpserver ............ SKIPPED
[INFO] Prometheus Java Simpleclient log4j ................. SKIPPED
[INFO] Prometheus Java Simpleclient log4j2 ................ SKIPPED
[INFO] Prometheus Java Simpleclient logback ............... SKIPPED
[INFO] Prometheus Java Simpleclient Pushgateway ........... SKIPPED
[INFO] Prometheus Java Simpleclient Servlet - Jakarta ..... SKIPPED
[INFO] Prometheus Java Simpleclient Spring Metrics ........ SKIPPED
[INFO] Prometheus Java Simpleclient Spring Boot Metric .... SKIPPED
[INFO] Prometheus Java Simpleclient Jetty ................. SKIPPED
[INFO] Prometheus Java Simpleclient Jetty JDK 8 ........... SKIPPED
[INFO] Prometheus Java Simpleclient Vert.x 3 .............. SKIPPED
[INFO] Prometheus Java Simpleclient Vert.x 4 .............. SKIPPED
[INFO] Prometheus Java Simpleclient BOM ................... SKIPPED
[INFO] Prometheus Java Client Benchmarks .................. SKIPPED
[INFO] Prometheus Java Suit - Integration Tests ........... SKIPPED
[INFO] Integration Tests - Common Utilities ............... SKIPPED
[INFO] Integration Tests - Exemplars with OpenTelemetry ... SKIPPED
[INFO] Integration Tests - Exemplars with the OpenTelemetry Agent SKIPPED
[INFO] Integration Tests - Java Versions .................. SKIPPED
[INFO] Integration Tests - Servlet Jakarta Exporter web.xml SKIPPED
[INFO] Integration Tests - Pushgateway .................... SKIPPED
[INFO] Integration Tests - log4j2 ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.061 s
[INFO] Finished at: 2022-12-07T18:06:50+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project simpleclient_tracer_common: Compilation failure: Compilation failure: 
[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :simpleclient_tracer_common
fstab commented 1 year ago

The current java_client version is still backwards compatible with Java 6. You need JDK <= 11 to compile it from source, because Java compilers later than 11 dropped support for Java 6 output.

I am currently working on an 1.0 release with a major refactoring (to support Prometheus native histograms). I think with that release we'll drop Java 6 support and use Java 8 as the baseline.

Note that this is only for compiling client_java from source. At runtime you can use client_java with any Java version >= 6, there are no compatibility issues at runtime.

hendrikebbers commented 1 year ago

I created a PR to add the info to the readme https://github.com/prometheus/client_java/pull/830

hendrikebbers commented 1 year ago

Next to this the build is still not working since simpleclient_caffeine depends on https://github.com/ben-manes/caffeine version 3.X that only supports Java 11+

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project simpleclient_caffeine: Compilation failure
[ERROR] /Users/hendrikebbers/git/prometheus_client_java/simpleclient_caffeine/src/main/java/io/prometheus/client/cache/caffeine/CacheMetricsCollector.java:[3,42] cannot access com.github.benmanes.caffeine.cache.AsyncCache
[ERROR]   bad class file: /Users/hendrikebbers/.m2/repository/com/github/ben-manes/caffeine/caffeine/3.1.1/caffeine-3.1.1.jar(com/github/benmanes/caffeine/cache/AsyncCache.class)
[ERROR]     class file has wrong version 55.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.
fstab commented 1 year ago

With Java 11 the project should build successfully.