I have a simple test case. Windows 10.
Java file
projsrcmainkotlincothonatyksandbobxSandbox.java
package cothonaty.ksandbobx;
public class Sandbox {
public static void main(String[] args) {
System.out.println("asd");
}
}
The project in Intellij in set initially with Gradle as a Kotlin project.
What I am trying to understand is next:
When I press the green triangle run button near by the main method, it runs the standard “Application” configuration which outputs the next log:
0:56:34: Executing ':Sandbox.main()'...
> Task :checkKotlinGradlePluginConfigurationErrors
> Task :compileKotlin NO-SOURCE
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :Sandbox.main()
asd
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.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 279ms
3 actionable tasks: 2 executed, 1 up-to-date
0:56:35: Execution finished ':Sandbox.main()'.
What I need to do is to run the app without any deprecated options.
Here is my kts
plugins {
kotlin("jvm") version "1.9.23"
}
group = "cothonaty.ksandbobx"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(21)
}
java {
sourceSets {
main {
java {
setSrcDirs(listOf("src/main/kotlin"))
}
}
}
}
The main goal – I need to run the “Application” configuration with the flag –warning-mode all.
However, I cannot find where I should put the –warning-mode all option in the “Application” type of configuration.
I understand that I can use terminal (or cmd in my case) to perform gradle run –warning-mode all. However, it starts downloading some chain toolkit with 192 MB size that I don’t really need on my PC as I can freely run without any downloads now from the “Application” configuration.
Please advise how I can run the blue Application configuration with the flag –warning-mode all.
Please do not advise to use terminal/cmd to perform a separate run. I need to run it with the flag from the Intellij Idea embedded environment, not from the separate gradle proccess. I understand that Intellij for sure runs its own Gradle, but I need to put the flat –warning-mode all into this Intellij’s Application run configuration.
I tried to add and run the Gradle configuration, however, in this case, I need to edit my kts what I dont want to do by principles as Intellij Idea able to run it without any edits in the kts.
Everything I described in the post
cothonaty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.