gradle assemble: Usage, Options & Common CI Errors
Produce artifacts only - no tests, no checks.
assemble is the Gradle lifecycle task that produces all of the project’s output artifacts (such as the jar) without running any verification. It is the right task when you need the build outputs but want to run tests separately.
What it does
assemble depends on the artifact-producing tasks (jar, war, etc.) but not on check or test. It is faster than build and is commonly used to split "produce artifact" from "run tests" into separate CI stages.
Common usage
./gradlew assemble
./gradlew assemble --build-cache
./gradlew clean assembleCommon error in CI (and the fix)
Symptom: assemble fails with "Could not resolve all files for configuration ':compileClasspath'" / "Could not find com.example:lib:1.2.3". Cause: a declared dependency cannot be resolved from the configured repositories. Fix: confirm the dependency exists and the right repositories {} are declared (mavenCentral(), internal repo with credentials), then re-run with --refresh-dependencies if the failure was a stale cached miss.