unnsse
04/29/2025, 9:55 AM./gradlew test
from the command line...
Using Gradle 8.14
wrote a kts project and whereas it was working before in my macOS based command line:
./gradlew clean test
Reusing configuration cache.
BUILD SUCCESSFUL in 750ms
4 actionable tasks: 4 executed
Configuration cache entry reused.
Am able to run my tests from IntelliJ but this is all it does?Adam S
04/29/2025, 9:59 AMunnsse
04/29/2025, 10:17 AM/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details on building Java & JVM projects, please refer to <https://docs.gradle.org/8.14/userguide/building_java_projects.html> in the Gradle documentation.
*/
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
application
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit Jupiter for testing.
testImplementation(libs.junit.jupiter)
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// This dependency is used by the application.
implementation(libs.guava)
}
// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(23)
}
}
application {
// Define the main class for the application.
mainClass = "org.example.MyConsoleApp"
}
tasks.named<Test>("test") {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
unnsse
04/29/2025, 10:22 AM.cache
folder and tried re-installing via Homebrew.unnsse
04/29/2025, 10:33 AM./gradlew clean test
Reusing configuration cache.
BUILD SUCCESSFUL in 720ms
unnsse
04/29/2025, 10:52 AMtasks.named<Test>("test") {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
unnsse
04/29/2025, 10:52 AM./gradlew clean test
unnsse
04/29/2025, 10:53 AM./gradlew test
, outputs only this:
Reusing configuration cache.
BUILD SUCCESSFUL in 345ms
3 actionable tasks: 3 up-to-date
Configuration cache entry reused.
unnsse
04/29/2025, 10:54 AMclean
each time?Vampire
04/29/2025, 11:33 AMclean
or you have a build bug.
If you run with --info
or --scan
and looking at the build scan, you should see that your test task is simply up-to-date. If nothing changed, there is no point in re-executing the tests.
One of the biggest strengths of Gradle is its ability to avoid unnecessary work.
If you want to re-run the tests although nothing changed, just add --rerun
after test
which will disable the up-to-date check and build cache.