Build tooling
Gradle project dependency
Adds another project as a dependency. Static Gradle 9.2.0 example; Gradle execution unverified.
Formal Syntax & Structure
java syntaxjava
implementation(project(":core"))Working Example
Example Snippetjava
plugins { application }dependencies { implementation(project(":core")) }application { mainClass.set("example.bookstore.Main") }java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) }}tasks.withType<JavaCompile>().configureEach { options.release.set(21) options.encoding = "UTF-8" options.compilerArgs.add("-proc:none")}tasks.withType<Jar>().configureEach { isPreserveFileTimestamps = false isReproducibleFileOrder = true}val verifyReceipt = tasks.register<JavaExec>("verifyReceipt") { classpath = sourceSets["main"].runtimeClasspath mainClass.set("example.bookstore.Main") args("--verify")}tasks.named("check") { dependsOn(verifyReceipt) }