quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Quarkus-Gradle-Plugin uses deprecated methods

Open mschorsch opened this issue 11 months ago • 4 comments

Describe the bug

The Quarkus-Gradle-Plugin uses deprecated methods

...
> Configure project :server
The resolvable usage is already allowed on configuration ':server:quarkusGeneratedSourcesRuntimeClasspath'. This behavior has been deprecated. This behavior is scheduled to be removed in Gradle 9.0. Remove the call to setCanBeResolved(true), it has no effect. Consult the upgrading guide for further informat
ion: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#redundant_configuration_usage_activation
The resolvable usage is already allowed on configuration ':server:quarkusTestGeneratedSourcesRuntimeClasspath'. This behavior has been deprecated. This behavior is scheduled to be removed in Gradle 9.0. Remove the call to setCanBeResolved(true), it has no effect. Consult the upgrading guide for further info
rmation: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#redundant_configuration_usage_activation
...
> Task :server:quarkusGenerateCode
The BuildIdentifier.getName() method has been deprecated. This is scheduled to be removed in Gradle 9.0. Use getBuildPath() to get a unique identifier for the build. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#build_identifier_name_and_
current_deprecation
...

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

reproducer.zip

Run ./gradlew clean build --console=plain --warning-mode=all --rerun-tasks --build-cache --parallel

Output of uname -a or ver

No response

Output of java -version

Java 17

Quarkus version or git rev

Quarkus 3.8.1

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.6

Additional information

No response

mschorsch avatar Mar 06 '24 11:03 mschorsch

/cc @glefloch, @quarkusio/devtools

quarkus-bot[bot] avatar Mar 06 '24 11:03 quarkus-bot[bot]

@aloubyansky: You have been mentioned in other issues in connection with Gradle and the Quarkus plugin so I hope you can help here.

mschorsch avatar Apr 23 '24 06:04 mschorsch

I don't see setCanBeResolved(true) calls in our code, there must be something else triggering these.

aloubyansky avatar Apr 23 '24 13:04 aloubyansky

Tested with Quarkus 3.9.4, Quarkus 999-SNAPSHOT and Gradle 8.7. The deprecation warning is still there.

mschorsch avatar Apr 24 '24 06:04 mschorsch

I'm also still seeing this deprecation warning for BuildIdentifier.getName() which looks like it is being used in by the quarkus class io.quarkus.gradle.tooling.dependency.DependencyUtils based on this stacktrace:

at org.gradle.api.internal.artifacts.DefaultBuildIdentifier.getName(DefaultBuildIdentifier.java:48)	
	at io.quarkus.gradle.tooling.dependency.DependencyUtils.getExtensionInfoOrNull(DependencyUtils.java:100)	
	at io.quarkus.gradle.dependency.ConditionalDependenciesEnabler.collectConditionalDependencies(ConditionalDependenciesEnabler.java:94)	
	at io.quarkus.gradle.dependency.ConditionalDependenciesEnabler.<init>(ConditionalDependenciesEnabler.java:51)	
	at io.quarkus.gradle.dependency.ApplicationDeploymentClasspathBuilder.lambda$setUpDeploymentConfiguration$10(ApplicationDeploymentClasspathBuilder.java:205)	
	at org.gradle.api.internal.provider.DefaultProvider.calculateOwnValue(DefaultProvider.java:72)

link to usage of deprecated method in source: https://github.com/quarkusio/quarkus/blob/9a768bbec0f3e9db839d7bf61f8594174999380c/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/dependency/DependencyUtils.java#L100

The deprecated method recommends using getBuildPath instead and to use that for comparing builds to compare included builds. It looks like this value is comapred in ToolingUtils.includedBuild:

https://github.com/quarkusio/quarkus/blob/9a768bbec0f3e9db839d7bf61f8594174999380c/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/ToolingUtils.java#L54

so just updating both locations to use BuildIdentifier.getBuildPath instead of BuildIdentifier.getName would be sufficient to help prepare quarkus builds for Gradle 9.

ryandens avatar Apr 29 '24 03:04 ryandens

Thranks @ryandens

@aloubyansky Tested with Quarkus 3.9.5 + Gradle 8.7

./gradlew clean build --warning-mode=all --rerun-tasks --build-cache --parallel --stacktrace

Here is the full stacktrace: full_stacktrace.md. Maybe this helps.

mschorsch avatar Apr 29 '24 05:04 mschorsch