diff --git a/build.gradle b/build.gradle
index 2c8728c..339d585 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,7 +1,34 @@
group 'excel2db'
-version '1.0'
+version '2.0'
apply plugin: 'java'
+apply plugin: 'com.github.johnrengelman.shadow'
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
+ }
+}
+
+sourceSets {
+ main {
+ java {
+ exclude 'src/main/resources/excel2db.properties'
+ }
+ }
+}
+
+//For building a single jar with all dependencies run "gradlew shadowJar"
+// Configure the shadow jar task
+shadowJar {
+ // exclude properties file from jar
+ exclude('excel2db.properties')
+ mergeServiceFiles()
+}
+
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
@@ -14,13 +41,11 @@ repositories {
dependencies {
compile project (":common")
-// compile files('libs/common.jar')
compile 'ch.qos.logback:logback-classic:1.2.2'
-// compile('org.springframework:spring-context:4.3.7.RELEASE') {
-// exclude module: 'commons-logging' // force Spring to use jcl-over-slf4j bridge
-// }
compile 'javax.persistence:persistence-api:1.0.2'
- compile 'org.springframework:spring-context:4.3.7.RELEASE'
+ compile ('org.springframework:spring-context:4.3.7.RELEASE'){
+ //exclude module: 'commons-logging' // force Spring to use jcl-over-slf4j bridge
+ }
compile 'org.apache.poi:poi:3.15'
compile 'org.apache.poi:poi-ooxml:3.15'
compile 'org.postgresql:postgresql:42.0.0.jre7'
@@ -30,17 +55,23 @@ dependencies {
jar {
+
manifest {
attributes(
- "Implementation-Title": "Gradle",
- "Implementation-Version": version,
- "Main-Class": "excel2db.excel2db"
- )
+ "Implementation-Title": "Gradle",
+ "Implementation-Version": version,
+ "Main-Class": "excel2db.excel2db"
+ )
}
- from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
+ from {
+ configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
+ }
}
+
+
+
diff --git a/src/main/resources/spring.xml b/src/main/resources/spring.xml
index 85fda6f..b2cc20f 100644
--- a/src/main/resources/spring.xml
+++ b/src/main/resources/spring.xml
@@ -13,6 +13,7 @@
+