Gradle task to put jars from Maven repository into

2019-03-30 01:25发布

http://blog.jonasbandi.net/2014/03/running-nodejs-applications-on-jvm-with.html describes how to prepare to run Avatar.js project.

For a Avatar.js project some jar and native binaries are at maven repository https://maven.java.net/content/repositories/public/com/oracle/

I'd like to use gradle task to get jars from Maven repository and put into lib folder. The research show it is possible.

http://forums.gradle.org/gradle/topics/create_a_local_mirror_for_dependencies

http://gradle.1045684.n5.nabble.com/collecting-only-external-dependency-files-td5117615.html#a5680602

Is there some more standard implementation of such task as of April 2014 ?

UPDATE:

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'

repositories {
    maven {
        url "https://maven.java.net/content/repositories/public/"
    }
}

dependencies {
    compile "com.oracle.avatar-js:avatar-js:0.10.+"
}

task copyLibs(type: Copy) {
    from configurations.compile
    into 'lib'
}

1条回答
混吃等死
2楼-- · 2019-03-30 02:03

Sample script:

apply plugin: 'java'

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    compile 'com.google.guava:guava:16.0.1'
}

task copyLibs(type: Copy) {
    from configurations.compile
    into 'lib'
}
查看更多
登录 后发表回答