From 95899c2840dd547f172858806ef2e3899a46b057 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 7 Apr 2019 00:22:58 -0700 Subject: [PATCH] Reverted to using a lib directory, the fatjar was causing problems with log4j not finding the configuration file. --- build.gradle | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 9884175..48760c0 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,6 @@ plugins { id "com.github.spotbugs" version "1.7.1" id "net.thauvin.erik.gradle.semver" version "0.9.9-beta" id "org.sonarqube" version "2.7" - id "com.github.johnrengelman.shadow" version "5.0.0" } @@ -35,29 +34,29 @@ dependencies { annotationProcessor semverProcessor compileOnly semverProcessor - implementation 'pircbot:pircbot:1.5.0' + compile 'pircbot:pircbot:1.5.0' compileOnly 'pircbot:pircbot:1.5.0:sources' - implementation 'org.apache.logging.log4j:log4j-api:2.11.2' - implementation 'org.apache.logging.log4j:log4j-core:2.11.2' - implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.2' + compile 'org.apache.logging.log4j:log4j-api:2.11.2' + compile 'org.apache.logging.log4j:log4j-core:2.11.2' + compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.2' - implementation 'commons-cli:commons-cli:1.4' + compile 'commons-cli:commons-cli:1.4' - implementation 'commons-net:commons-net:3.6' - implementation 'com.squareup.okhttp3:okhttp:3.14.0' + compile 'commons-net:commons-net:3.6' + compile 'com.squareup.okhttp3:okhttp:3.14.0' - implementation 'com.rometools:rome:1.12.0' + compile 'com.rometools:rome:1.12.0' - implementation 'org.json:json:20180813' - implementation 'org.ostermiller:utils:1.07.00' - implementation 'org.jsoup:jsoup:1.11.3' - implementation 'net.objecthunter:exp4j:0.4.8' + compile 'org.json:json:20180813' + compile 'org.ostermiller:utils:1.07.00' + compile 'org.jsoup:jsoup:1.11.3' + compile 'net.objecthunter:exp4j:0.4.8' - implementation 'org.twitter4j:twitter4j-core:4.0.7' - implementation 'net.thauvin.erik:pinboard-poster:1.0.0' + compile 'org.twitter4j:twitter4j-core:4.0.7' + compile 'net.thauvin.erik:pinboard-poster:1.0.0' - implementation 'net.aksingh:owm-japis:2.5.2.3' + compile 'net.aksingh:owm-japis:2.5.2.3' testImplementation 'org.testng:testng:6.14.3' testImplementation 'org.assertj:assertj-core:3.12.2' @@ -82,11 +81,9 @@ javadoc { } jar { - manifest.attributes('Main-Class': mainClassName) -} + manifest.attributes('Main-Class': mainClassName, + 'Class-Path': '. ./lib/' + configurations.compile.collect { it.getName() }.join(' ./lib/')) -shadowJar { - classifier = null version = null } @@ -127,15 +124,21 @@ tasks.withType(SpotBugsTask) { task copyToDeploy(type: Copy) { from('properties') - from shadowJar + from jar into deployDir } +task copyToDeployLib(type: Copy) { + from configurations.compile + into deployDir + '/lib' +} + task deploy(dependsOn: ['build']) { description = 'Copies all needed files to the ${deployDir} directory.' group = 'Publishing' outputs.dir deployDir inputs.files copyToDeploy + inputs.files copyToDeployLib doLast { file(deployDir + '/logs').mkdir() }