Without the Gradle War Plugin, the bootRepackage task depends on the jar task, but with the Gradle War Plugin, it depends on the war task.
How can I change it to depend on the jar task, although I use the Gradle War Plugin?
UPDATE:
I use the war task to create a war file, including documents that will be deployed to the documentation server, and I want to use the bootRepackage d jar file to provide the service. My war task depends on the asciidoctor task, which depends on the test task (I use Spring REST Docs.), But I don't want to run the asciidoctor or test task when using bootRepackage .
I solved the problem with the following setup:
ext { mainClassName = 'com.izeye.throwaway.Application' } task myBootRepackage(type: BootRepackage, dependsOn: jar) { }
but I'm not sure this is a good practice.
This is an example project having the above configuration:
https://github.com/izeye/spring-boot-throwaway-branches/tree/war
source share