1212 */
1313
1414apply plugin : ' java'
15- apply plugin : " eu.appsatori.fatjar"
1615apply plugin : ' maven'
1716apply plugin : ' signing'
17+ apply plugin : ' com.github.johnrengelman.shadow'
1818
1919group = ' com.sendgrid'
2020version = ' 4.0.0'
@@ -37,12 +37,10 @@ task wrapper(type: Wrapper) {
3737
3838buildscript {
3939 dependencies {
40- classpath ' eu.appsatori: gradle-fatjar-plugin:0.3 ' // adds fatJar task
40+ classpath ' com.github.jengelman. gradle.plugins:shadow:1.2.4 '
4141 }
4242 repositories {
43- maven {
44- url " https://plugins.gradle.org/m2/"
45- }
43+ jcenter()
4644 }
4745}
4846
@@ -66,33 +64,36 @@ allprojects {
6664 }
6765}
6866
69- // adds 'with-dependencies' to the fatJar name
70- fatJar {
67+ // adds 'with-dependencies' to the shadowJar name
68+ shadowJar {
7169 classifier ' jar'
7270 baseName " sendgrid-java-http-client"
71+ version version
72+ }
73+ jar {
7374 manifest {
7475 attributes(" Implementation-Title" : " http" , " Implementation-Version" : version)
7576 }
7677}
7778
78- // copy fatJar to base project directory so they will be in git (and on github for download)
79+ // copy shadowJar to base project directory so they will be in git (and on github for download)
7980build << {
8081 copy {
81- println " Copying ${ fatJar .archiveName} to $projectDir /repo/com/sendgrid/$version "
82- from(" $buildDir /libs/${ fatJar .archiveName} " )
82+ println " Copying ${ shadowJar .archiveName} to $projectDir /repo/com/sendgrid/$version "
83+ from(" $buildDir /libs/${ shadowJar .archiveName} " )
8384 into(" $projectDir /repo/com/sendgrid/$version " )
8485 }
8586 copy {
86- println " Copying ${ fatJar .archiveName} to $projectDir /repo/com/sendgrid"
87- from(" $buildDir /libs/${ fatJar .archiveName} " )
87+ println " Copying ${ shadowJar .archiveName} to $projectDir /repo/com/sendgrid"
88+ from(" $buildDir /libs/${ shadowJar .archiveName} " )
8889 into(" $projectDir /repo/com/sendgrid" )
8990 }
9091 tasks. renameSendGridVersionJarToSendGridJar. execute()
9192}
9293
9394task renameSendGridVersionJarToSendGridJar {
9495 doLast {
95- file(" $projectDir /repo/com/sendgrid/${ fatJar .archiveName} " ). renameTo(file(" $projectDir /repo/com/sendgrid/http-jar.jar" ))
96+ file(" $projectDir /repo/com/sendgrid/${ shadowJar .archiveName} " ). renameTo(file(" $projectDir /repo/com/sendgrid/http-jar.jar" ))
9697 }
9798}
9899
@@ -151,7 +152,7 @@ uploadArchives {
151152}
152153
153154artifacts {
154- archives fatJar
155+ archives shadowJar
155156 archives jar
156157 archives javadocJar
157158 archives sourcesJar
0 commit comments