6

When I reload my Gradle Project in IntelliJ, I get the following output:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings

However, running gradle commands on the command line, such as tasks or build does not produce this output, even with --warning-mode all.

In order to identify the deprecated features, how can I reproduce what IntelliJ is doing on the command line, or do the equivalent of passing --warning-mode all to Gradle via IntelliJ?

I'm using Gradle 7.0 with the Gradle wrapper, and IntelliJ is set to use the version in gradle-wrapper.properties.

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
  • Hi, same error here. I have gradle v7.0.2 installed locally and android studio is pointing to the same. No idea where v8 is coming from. Did you find a fix? – Dazzle May 20 '21 at 22:04

2 Answers2

1

To have IntelliJ run with the warning mode, add it to the gradle.properties file (create the file if it does not exist):

org.gradle.warning.mode=all

I have a new Java Gradle project generated with IntelliJ and run the main from the IDE. When running with this option Gradle explains what's wrong, and indicates the location in the .gradle script IntelliJ is using containing the deprecated property:

Configure project : The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the mainClass property instead. See https://docs.gradle.org/7.4/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main for more details. at StartApplication_main__1_87e3b1xfpa17mk8z0q8rqeouu$_run_closure1$_closure2$_closure3.doCall(C:\Users\...\AppData\Local\Temp\StartApplication_main__1.gradle:23) (Run with --stacktrace to get the full stack trace of this deprecation warning.)

The cause of your deprecation warning may be different (like having jcenter() as suggested by @amitesh-mondal ). Adding the warning property will tell you the cause.

Catweazle
  • 619
  • 12
  • 25
-1

in settings.gradle comment out like // jcenter() // Warning: this repository is going to shut down soon

This is going to solve the issue