Copy task does not copy compile dependencies


(Alex Soto) #1

Hello, I know it might be stupid question and probably the solution is something that now I cannot see but with given script:

apply plugin: 'java'

repositories {
    jcenter()
}

dependencies {
    compile 'org.slf4j:slf4j-api:1.7.21'
    testCompile 'junit:junit:4.12'
}

task copyToLib(type: Copy) {
    from configurations.compile
    into "$buildDir"
}


build.dependsOn(copyToLib)

Does not copy anything. I have done a println on the task and I can see that the task is executed but dependencies are not copied.

I am using Gradle 2.14.1.

Thank you so much.


(Sterling Greene) #2

After running ./gradlew copyToLib, I see:

build
└── slf4j-api-1.7.21.jar

Are you looking for the files to be in build/libs maybe?