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+"
}
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://www.yongbi.net/rss/response/602

트랙백 주소 :: http://www.yongbi.net/trackback/602

트랙백 RSS :: http://www.yongbi.net/rss/trackback/602

댓글을 달아 주세요

댓글 RSS 주소 : http://www.yongbi.net/rss/comment/602
[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다