How to specify tasks to be excluded from a GradleBuild task?


(kevin.stembridge.dev) #1

Hi folks, I am using the GradleBuild task to invoke a build in a different project. On GradleBuild we can specify tasks to be executed but not tasks to be excluded.

I thought I might be able to use the StartParameter like so, but it doesn’t have any effect.

task buildAppserver(type: GradleBuild) {
     dir = "../appserver"
     tasks = ["clean", "build"]
     getStartParameter().setExcludedTaskNames(['test']);
}

Is there any way to specify tasks to be excluded from the GradleBuild task?


(René Groeschke) #2

Hey, your snippet looks correct to me. What is the output of the buildAppserver task? Can you share it?

cheers, René


(kevin.stembridge.dev) #3

My apologies, you’re right, its working.

I’m still thinking in a Maven way. Unlike Maven, It looks like Gradle still does all the test-related tasks such as compiling and jarring but not actually executing the tests.

I think you’re approach is better.

Sorry for wasting your time.


(René Groeschke) #4

no problem