Gradle Build Script with Dependencies jars :: 2014/07/11 13:11

Gradle Version : 1.12


One jar Package included all dependencies

apply plugin: 'java'
version '1.0'

jar {
//All dependencies into one jar.
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
manifest {
attributes 'Implementation-Title':'Title', 'Implementation-Version': version
}
}


repositories {
    mavenCentral()
}

dependencies {
compile project(':common:logger')
compile group:"redis.clients", name:"jedis", version:"2.4.2"
compile group:"org.apache.httpcomponents", name:"httpclient", version:"4.3.3"
compile group:"org.apache.httpcomponents", name:"httpmime", version:"4.3.3"
compile group:"org.eclipse.jetty", name:"jetty-servlet", version:"9.2.0.RC0"
compile group:"com.sun.jersey", name:"jersey-bundle", version:"1.18.1"
compile group:"com.google.code.gson", name:"gson", version:"2.2.4"
compile group:"com.github.jedis-lock", name:"jedis-lock", version:"1.0.0"
compile group:"org.mongodb", name:"mongo-java-driver", version:"2.12.1"
compile group:"com.ning", name:"async-http-client", version:"1.8.9"
testCompile group:"junit", name:"junit", version:"4.11+"
}

One jar Package referenced all dependencies (Copy into lib folder)

apply plugin: 'java'
version '1.0'

//Copy all dependencies
task copyToLib( type: Copy ) {
    into "$buildDir/libs/lib"
    from configurations.runtime
}

jar {
       //Copy all dependencies
       dependsOn copyToLib

manifest {
attributes 'Implementation-Title':'Title', 'Implementation-Version': version
}
}


repositories {
    mavenCentral()
}

dependencies {
compile project(':common:logger')
compile group:"redis.clients", name:"jedis", version:"2.4.2"
compile group:"org.apache.httpcomponents", name:"httpclient", version:"4.3.3"
compile group:"org.apache.httpcomponents", name:"httpmime", version:"4.3.3"
compile group:"org.eclipse.jetty", name:"jetty-servlet", version:"9.2.0.RC0"
compile group:"com.sun.jersey", name:"jersey-bundle", version:"1.18.1"
compile group:"com.google.code.gson", name:"gson", version:"2.2.4"
compile group:"com.github.jedis-lock", name:"jedis-lock", version:"1.0.0"
compile group:"org.mongodb", name:"mongo-java-driver", version:"2.12.1"
compile group:"com.ning", name:"async-http-client", version:"1.8.9"
testCompile group:"junit", name:"junit", version:"4.11+"
}

2014/07/11 13:11 2014/07/11 13:11
Trackback Address :: http://www.yongbi.net/trackback/602
[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다
Name
Password
Homepage

Secret
< PREV |  1  |  ...  193  |  194  |  195  |  196  |  197  |  198  |  199  |  200  |  201  |  ...  566  |  NEXT >