Copying transitive dependency in gradle

278 Views Asked by At

I am completely newbie to Gradle so please forgive me if my question is not correct. I am using the Distribution plugin to create a ZIP file of my project. I want to implement YAJSW Wrapper service in my project. In Maven, we can use Assembly Plugin to define which dependency goes where, but in Gradle I couldn't really found a way to access each dependency separately.

I have looked everywhere, but couldn't really get a solution. I am trying to copy compile configuration's dependencies in different folders. I can include whatever I want to as long as I know the file name (since a configuration is a filecollection). But, I want to copy those transitive dependencies as well which I don't know (I know I can look for the files separately, but I don't want it to be so much of manual work). Below is a part of my code to give you an idea of what exactly I am doing right now:

distributions {
main {
    baseName "BaseZIP"
    contents {
        from { "src/main/resources" }            
        into('service') {
            from(project.configurations.compile) {
                include 'wrapper**'
            }
        }
        into('service/lib/core/commons') {
            from(project.configurations.compile) {
                include 'commons-cli**'
                include 'commons-collections**'
                include 'commons-configuration**'
                include 'commons-io**'
                include 'commons-logging**'
                include 'commons-vfs2**'
                include 'commons-lang**'
            }
        }}

Could you please help me here. It might be possible that I have missed some concept completely. I hope my questions makes sense :( Thanks in advance!

0

There are 0 best solutions below