Last active
February 5, 2017 03:39
-
-
Save mrserverless/170efc94faa7fe974207 to your computer and use it in GitHub Desktop.
Dropwizard build.gradle with ShadowJar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.2' | |
} | |
} | |
apply plugin: 'maven' | |
apply plugin: 'java' | |
apply plugin: 'application' | |
apply plugin: 'com.github.johnrengelman.shadow' | |
project.ext { | |
dropwizardVersion = '0.8.0-SNAPSHOT' | |
} | |
mainClassName = 'com.yunspace.dropwizard.example.ShadowApplication' | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
} | |
dependencies { | |
// dropwizard | |
compile 'io.dropwizard:dropwizard-core:' + dropwizardVersion | |
// test | |
testCompile 'junit:junit:4.11' | |
compile 'io.dropwizard:dropwizard-testing:' + dropwizardVersion | |
} | |
task wrapper(type: Wrapper) { | |
gradleVersion = '2.1' | |
} | |
// Configure the shadow jar task | |
shadowJar { | |
mergeServiceFiles() | |
exclude 'META-INF/*.DSA' | |
exclude 'META-INF/*.RSA' | |
} | |
jar { | |
manifest { | |
attributes 'Main-Class': mainClassName | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! First I was having issues with OneJar and Dropwizard-Sundial annotated-jobs-package-name not being found in the single jar with all the dependencies. Then using the default shadowJar configuration did not find
Using your shadowJar configuration sorted it out!