Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
apply plugin: 'groovy'
apply plugin: 'fatjar'
apply plugin: 'application'
apply plugin: 'project-report'
apply plugin: 'idea'
// The main class of the application
mainClassName = 'com.example.helloworld.HelloWorldService'
// Use Java 7 by default
sourceCompatibility = 1.7
targetCompatibility = 1.7
// Add Gradle FatJar Plugin, see https://github.com/musketyr/gradle-fatjar-plugin
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'eu.appsatori', name: 'gradle-fatjar-plugin', version: '0.1.3'
}
}
// Set our project variables
project.ext {
dropwizardVersion = '0.6.2'
dropWizardConfig = './src/dist/config/example.yml'
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'com.yammer.dropwizard', name: 'dropwizard-core', version: dropwizardVersion
compile group: 'com.yammer.dropwizard', name: 'dropwizard-hibernate', version: dropwizardVersion
compile group: 'com.yammer.dropwizard', name: 'dropwizard-migrations', version: dropwizardVersion
compile group: 'com.yammer.dropwizard', name: 'dropwizard-auth', version: dropwizardVersion
compile group: 'com.h2database', name: 'h2', version: '1.3.171'
// this dependency is needed due to http://issues.gradle.org/browse/GRADLE-2647
compile "com.sun.jersey:jersey-client:1.15"
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.1.3'
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M10'
}
// Configure the fatJar task
fatJar {
classifier 'fat'
// We need to add the main class to the manifest, otherwise the JAR won't start.
manifest {
attributes 'Main-Class': mainClassName
}
// We have to exclude signature files from the fat JAR, otherwise we'll get invalid signature file digest errors.
exclude 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.SF'
}
// Configure the run task to start the Dropwizard service
run {
args 'server', dropWizardConfig
}
task stage(dependsOn: ['clean', 'fatJar'])