Skip to content

Instantly share code, notes, and snippets.

@breskeby
Created February 14, 2018 13:55
Show Gist options
  • Save breskeby/bc63a4ecb05c1137e55ab21e9c75fb8e to your computer and use it in GitHub Desktop.
Save breskeby/bc63a4ecb05c1137e55ab21e9c75fb8e to your computer and use it in GitHub Desktop.
multiple failures in composites
apply plugin: 'java'
group "org.sample"
version "1.0"
dependencies {
compile "org.sample:included-Sub1:1.0"
compile "org.sample:included-Sub2:1.0"
}
gradle.buildFinished {
it.failure.causes.each {
println it
}
}
class AnotherThing {} // enforce compilation task to run
class Thing {} // to enforce compilation task to run
allprojects {
apply plugin: 'java'
group "org.sample"
version "1.0"
compileJava.doFirst{ throw new RuntimeException('boom!') }
}
include 'included-Sub1'
include 'included-Sub2'
gradle --no-daemon clean build --console plain
:clean
:included:included-Sub2:compileJava
:processResources NO-SOURCE
:processTestResources NO-SOURCE
:included:included-Sub2:compileJava FAILED
:compileJava
:classes
:jar
:assemble
:compileTestJava NO-SOURCE
:testClasses UP-TO-DATE
:test NO-SOURCE
:check UP-TO-DATE
:build
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/Rene/dev/temp/multibuilderrors/included/build.gradle' line: 6
* What went wrong:
Execution failed for task ':included:included-Sub2:compileJava'.
> boom!
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* Where:
Build file '/Users/Rene/dev/temp/multibuilderrors/included/build.gradle' line: 6
* What went wrong:
Execution failed for task ':included:included-Sub2:compileJava'.
> boom!
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
3 actionable tasks: 3 executed
org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/Rene/dev/temp/multibuilderrors/included/build.gradle' line: 6
Execution failed for task ':included:included-Sub2:compileJava'.
org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/Rene/dev/temp/multibuilderrors/included/build.gradle' line: 6
Execution failed for task ':included:included-Sub2:compileJava'.
rootProject.name = 'root-project'
includeBuild 'included'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment