Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0

When I try to run Java project from IntelliJ IDEA, I get this error

Execution failed for task ':ISO8583Request.main()'.
> Process 'command 'C:\Program Files\Eclipse Adoptium\jdk-\bin\java.exe'' finished with non-zero exit value 1

* Try:
> 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.
> Get more help at
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to in the Gradle documentation.
2 actionable tasks: 1 executed, 1 up-to-date

I have Gradle 8.4 installed.

I tried multiple solutions from StackOverflow, but nothing helped. Any ideas? And how it’s reportind incomaptability with Gradle version that isn’t released yet (9)?

I don’t understand the question.

You use something that is marked as deprecated with planned removal for Gradle 9, so even with Gradle 9 not released yet, you already now know that you cannot upgrade to Gradle 9 without fixing that once it is released and could right away fix that incompatibility.

To know what exactly is the problem, it also tells you how to find out.
Just run with warning mode all.
If a build from commandline does not show the same deprecation warning, you can also increase the warning mode using as documented in the User Guide.

I’ve created file in the project root dir, and put --warning-mode=all. When I try to run, I get the same message, nothing verbose. I also tried to add this flag into run options inside my IDE, and still nothing (no verbose log).

If you put it to the arguments in IDE, you are configuring what is given to your class, not what is given to Gradle.
And you cannot just write the command-line option into the properties file, that’s why I said “as documented in the User Guide” as I don’t have it in my head what you need exactly and assume you can look it up yourself. :wink:

I wrote simple Java app with main method, and want to run it. When I run it from my IDE, I get the error that is in the first post. I just need to run it.

Well that warning does not prevent running, it is just a warning.
The process is started and ends with exit code 1 which then in turn makes the Gradle build fail.
Scroll up whether you output the problem, or run through debug and set a breakpoint to investigate what is happening.
That is not a Gradle topic, but just your program ending with non-0 exit code.

We started facing the same error, some builds when running check task started to fail without anything else than that message.

Checking the build scan, no task failed, only that info. The stack trace:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0
org.gradle.api.GradleException: Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0	
	at org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler.featureUsed(	
	at org.gradle.internal.deprecation.DeprecationLogger.nagUserWith(	
	at org.gradle.internal.deprecation.DeprecationLogger.nagUserWith(	
	at org.gradle.internal.deprecation.DeprecationMessageBuilder$WithDocumentation.nagUser(	
	at org.gradle.api.tasks.testing.AbstractTestTask.emitDeprecationMessage(	
	at org.gradle.api.tasks.testing.AbstractTestTask.handleCollectedResults(	
	at org.gradle.api.tasks.testing.AbstractTestTask.executeTests(	
	at org.gradle.api.tasks.testing.Test.executeTests(	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(	
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(	
	at org.gradle.internal.reflect.JavaMethod.invoke(	
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(	
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(	
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(	
	at org.gradle.api.internal.tasks.execution.TaskExecution$	
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(

Using --stacktrace I managed to identify the issue.
In our case is a combination of predictive test selection returning 0 tests (correct) with the test task failing because the no tests were executed.

The log shows:

No test executed. This behavior has been deprecated. This will fail with an error in Gradle 9.0. There are test sources present but no test was executed. Please check your test configuration. Consult the upgrading guide for further information:

But no where it tell really that is the cause of the failure. Also, this happens because predictive test selection resulted in 0 tests. I would expect it to automatically understand that is fine and not an issue.

So on our case the issues I see:

  • the failure is not clear, it is failing on the test task but no where it shows as failed (not in console, not in scan)
  • test task fails because no test was selected by predictive selection, that should automatically work

(btw, gradle version is 8.7)

Seems like the issues are fixed in

- [FIX] Predictive Test Selection: Gradle displays a "no test executed" deprecation warning when no tests are selected on Gradle 8.3 and later
1 Like