apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
1.09k stars 343 forks source link

[Improvement] Fix the gradle warning #4206

Open jerryshao opened 4 months ago

jerryshao commented 4 months ago

What would you like to be improved?

We have many Gradle script build warning, I think we can improve to remove the warnings, for example:

> Configure project :web
Kotlin DSL property assignment is an incubating feature.

> Configure project :catalogs:catalog-lakehouse-iceberg
w: file:///Users/jerryshao/Projects/gravitino/catalogs/catalog-lakehouse-iceberg/build.gradle.kts:98:7: Variable 'runtimeJars' is never used
w: file:///Users/jerryshao/Projects/gravitino/catalogs/catalog-lakehouse-iceberg/build.gradle.kts:158:57: Unchecked cast: Any? to (Test) -> Unit

> Configure project :catalogs:catalog-lakehouse-paimon
w: file:///Users/jerryshao/Projects/gravitino/catalogs/catalog-lakehouse-paimon/build.gradle.kts:89:7: Variable 'runtimeJars' is never used
w: file:///Users/jerryshao/Projects/gravitino/catalogs/catalog-lakehouse-paimon/build.gradle.kts:145:57: Unchecked cast: Any? to (Test) -> Unit

> Configure project :iceberg:iceberg-rest-server
w: file:///Users/jerryshao/Projects/gravitino/iceberg/iceberg-rest-server/build.gradle.kts:83:7: Variable 'runtimeJars' is never used
w: file:///Users/jerryshao/Projects/gravitino/iceberg/iceberg-rest-server/build.gradle.kts:139:57: Unchecked cast: Any? to (Test) -> Unit

> Configure project :spark-connector:spark-3.3
w: file:///Users/jerryshao/Projects/gravitino/spark-connector/v3.3/spark/build.gradle.kts:159:57: Unchecked cast: Any? to (Test) -> Unit

> Configure project :spark-connector:spark-3.4
w: file:///Users/jerryshao/Projects/gravitino/spark-connector/v3.4/spark/build.gradle.kts:159:57: Unchecked cast: Any? to (Test) -> Unit

> Configure project :spark-connector:spark-3.5
w: file:///Users/jerryshao/Projects/gravitino/spark-connector/v3.5/spark/build.gradle.kts:161:57: Unchecked cast: Any? to (Test) -> Unit

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 https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

Above are several warnings when we run gradle clean, I can fix it.

How should we improve?

No response

frankvicky commented 4 months ago

I would like to try to solve this issue, please assign it to me. Many thanks 😺

yuqi1129 commented 4 months ago

I would like to try to solve this issue, please assign it to me. Many thanks 😺

Nice, please go ahead, I will assign it to you.

justinmclean commented 3 months ago

@frankvicky How are you going this this? Are you still able to work on it?

frankvicky commented 3 months ago

Hi @justinmclean Unfortunately I dont have free cycle now, if this ticket is in a rush, feel free to reassign.

ChengyanOo commented 1 month ago

justinmclean Hi @justinmclean, I would love to work on this issue, could anyone assign this to me?

ChengyanOo commented 1 month ago

Hi @jerryshao, could you share your version of the 'gradle-wrapper.jar' file? I built the project with gradle-wrapper.jar(v8.11.0-M1) and didn't trigger these warnings, I am suspecting whether its because this?

jerryshao commented 1 month ago

You can just simply run the ./gradlew build to see the warnings, the script will download the wrapper jar automatically, you don't have to install it manually.

ChengyanOo commented 1 month ago

Hi @jerryshao, thanks for the explanation, I just re-built the program with "./gradlew build" a couple more times. However, I was only able to trigger the warnings thats in your screenshot for one time, and it seemed like after the dependencies were installed the warnings were also gone. I tried cleaning the cache but the warnings were still gone.

jerryshao commented 1 month ago

I think you should add arguments like --rerun-tasks to your grade command so that it will run all the tasks every time. Besides, since it is a long-time issue, some warning may already been fixed, so please fix the warnings as possible as you can.