aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
523 stars 151 forks source link

Unable to compile with gradle:7.4.2-jdk17 #173

Closed slayoffer closed 11 months ago

slayoffer commented 11 months ago

Description

Unable to compile with Docker

Expected Behavior

Docker should build OK as before

Actual Behavior

Dockerbuild fails with the following errors: ...

12 52.08 symbol: variable Response

12 52.08 location: class MetricsEndpoint

12 52.08 /spi/src/main/java/org/jboss/aerogear/keycloak/metrics/MetricsEndpoint.java:35: error: cannot find symbol

12 52.08 final StreamingOutput stream = output -> PrometheusExporter.instance().export(output);

12 52.08 ^

12 52.08 symbol: class StreamingOutput

12 52.08 location: class MetricsEndpoint

12 52.08 /spi/src/main/java/org/jboss/aerogear/keycloak/metrics/MetricsEndpoint.java:36: error: cannot find symbol

12 52.08 return Response.ok(stream).build();

12 52.08 ^

12 52.08 symbol: variable Response

12 52.08 location: class MetricsEndpoint

12 52.08 /spi/src/main/java/org/jboss/aerogear/keycloak/metrics/MetricsEndpointFactory.java:35: error: incompatible types: MetricsFilter cannot be converted to ContainerRequestFilter

12 52.08 providerFactory.getContainerRequestFilterRegistry().registerSingleton(filter);

12 52.09 ^

12 52.09 /spi/src/main/java/org/jboss/aerogear/keycloak/metrics/MetricsEndpointFactory.java:36: error: incompatible types: MetricsFilter cannot be converted to ContainerResponseFilter

12 52.09 providerFactory.getContainerResponseFilterRegistry().registerSingleton(filter);

...

12 80.60 54 errors

12 80.70

12 80.70 > Task :compileJava FAILED

12 80.70

12 80.70 Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

12 80.70

12 80.70 You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

12 80.70

12 80.70 See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

12 80.70 1 actionable task: 1 executed

12 80.70 Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory)

12 80.70

12 80.70 FAILURE: Build failed with an exception.

12 80.70

12 80.70 * What went wrong:

12 80.70 Execution failed for task ':compileJava'.

12 80.70 > Compilation failed; see the compiler error output for details.

12 80.70

12 80.70 * Try:

12 80.70 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

12 80.70

12 80.70 * Get more help at https://help.gradle.org/

12 80.70

12 80.70 BUILD FAILED in 1m 19s

12 ERROR: process "/bin/sh -c git clone https://github.com/aerogear/keycloak-metrics-spi.git . && ./gradlew jar" did not complete successfully: exit code: 1

Environment

Docker

Steps to reproduce

Try to build with the follwing Dockerfile:

FROM gradle:7.4.2-jdk17 AS metrics WORKDIR /spi USER root RUN chown -R gradle /spi USER gradle RUN git clone https://github.com/aerogear/keycloak-metrics-spi.git . \ && ./gradlew jar

slayoffer commented 11 months ago

resolved with Metrics version 3.0

RUN git clone https://github.com/aerogear/keycloak-metrics-spi.git . && git checkout https://github.com/aerogear/keycloak-metrics-spi/commit/8f59b5f1c430b03cf7366e076d3a193ba7bdafb1 && ./gradlew jar

sirkrypt0 commented 11 months ago

This issue appeared with 4.0 again (while not the same error message, the Gradle build is broken).