I'm using gradle 4.1 My project has five modules. After build I generate five jars in each module. My goal is to create a zip archive and upload it to artifactory server. I can only generate my zip deploy artifact with my jars only when build of other modules is complete. I see that it copies jars from libs directory, but I'm looking for a way to do this after the overall build of the project. I saw some examples with dependsOn, but it doesn't seem to be working. Here is what I have:
apply plugin: 'distribution'
distributions {
main {
baseName = 'b-deploy'
contents {
from { "b-model/build/libs/b-model-${version}.jar" }
from { "b-wsdl/build/libs/b-wsdl-${version}.jar" }
from { "b-common/build/libs/b-common-${version}.jar" }
from { "b-rest/build/libs/b-rest-${version}.jar" }
from { "b-soap/build/libs/b-soap-${version}.jar" }
}
}
}
Create a custom configuration to hold all you deployables:
Gather everything you need in your ZIP in that configuration. Note how you can add third-party libraries here, if you need them:
Then, create a task for that ZIP:
Finally, configure publishing:
Should do the trick.
Maybe you could use
finalizedBy
?.So in your example: