user3105453
user3105453

Reputation: 1981

Copy all jars from subprojects to root project’s bin directory

I'd like to copy every jar generated from subprojects from their /bin/libs dir to the root project's bin dir. Unfortunately, my current code just copies everything from the subprojects into that directory:

task muleapp(type: Copy) {
    from '.'
    include '**/bin/libs/*.jar'
    into 'bin'
}

How can I achieve the desired functionality?

Upvotes: 1

Views: 1805

Answers (1)

Alexiy
Alexiy

Reputation: 2030

Try this type of task:

task muleapp(type: Copy) {
    def jars=[]
    subprojects.each {
        jars+=it.libsDir
    }
    from jars
    into 'bin'
}

Upvotes: 3

Related Questions