Reputation: 3968
I have a third party packaged war published in artifactory. I need to create a gradle job that will grab the war from artifactory, explode it to a temporary directory, add some custom libraries(jars) to the WAR file and then repackage and publish it to another location in artifactory.
I am looking for suggestions on:
I have seen the gradle WAR plugin documentation and it seems we can specify a custom location from which the WAR should be repackaged.
Upvotes: 2
Views: 2638
Reputation: 23657
Partial answer: Add the artifactory artifact as a dependency to your gradle.build - which will fetch the artifact and cache it in gradle cache.
task unpack(type: Copy) {
def archivePath = project.configurations.compile.find{it.name.startsWith("something") }
def archiveFile = file(archivePath )
def outputDir = file("${buildDir}/unpacked/dist")
from zipTree(zipFile)
into outputDir
}
Upvotes: 1