Unpack wsdl schema from dependencies in Gradle


(Dmitry Senkovich) #1

I’ve got the following plugin configuration in a Maven (for now) project:


Unfortunately, I can’t find something similar in Gradle. The only thing I’ve found is creating a task, loading artifacts as zip files (specifying the whole path to the artifact) and then unzip it.

Is there any other alternative? Thank you very much for any help!

(Dmitry Senkovich) #2

Eventually, I ended up with the following task:

task copyWsdlFromArtifacts(type: Copy) {
    includeEmptyDirs = false
    def mavenLocalRepositoryUrl = repositories.mavenLocal().url
    ].each { artifact ->
        into "$buildDir/schema/"
        include '**/*.xsd', '**/*.wsdl'

(uklance) #3

You should do this via a configuration / dependencies rather than using maven local url.


configurations {
    wsdl { transitive = false}
dependencies {
    wsdl 'foo:wsdl1:1.0'
    wsdl 'bar:wsdl2:2.0'
task copyWsdlFromArtifacts(type: Copy) {
    includeEmptyDirs = false
    configurations.wsdl.each { artifact ->
        from zipTree(artifact)
    into "$buildDir/schema/"
    include '**/*.xsd', '**/*.wsdl'

(Dmitry Senkovich) #4

Wow, that is cool! Thank you very much! Sorry, I’m just getting started with Gradle, we’re only considering migrating to Gradle.