gradle - Run my task before a plugin's task? -


we're using gradle file build java war file. know little gradle. @ top of build.gradle:

apply plugin: 'java' apply plugin: 'maven' apply plugin: 'war' 

we run gradle gradle clean install. i'm not sure these tasks defined assume they're in 1 of plugins (i'd guess war).

when run gradle clean install seems print tasks run:

:clean :compilejava :processresources :classes :war :install 

correct me if i'm wrong, seems task install dependson compilejava, processresources, classes, , war.

i need task i've written run sometime after clean sometime before war. preferably without modifying plugin.

i've tried indicating task mustrunafter processresources doesn't work way.

how can inject task dependency on install before dependency war?

you can declare task dependencies explicitly.

add following code build.gradle file

tasks.war.dependson("yourtasknamehere") tasks["yourtasknamehere"].dependson("clean") 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -