Skip to content

Instantly share code, notes, and snippets.

@devacto
Created July 1, 2014 07:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save devacto/65e883156e24729da374 to your computer and use it in GitHub Desktop.
Save devacto/65e883156e24729da374 to your computer and use it in GitHub Desktop.
Example Gradle build file for use with Dropwizard.
apply plugin: 'java'
apply plugin: 'gradle-one-jar'
apply plugin: 'application'
// Use Java 8 by default
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// The main class of the application
mainClassName = 'au.com.ioof.retailinsurance.aiaconsumerservice.AIAConsumerServiceApplication'
// Add Gradle OneJarPlugin, see https:github.com/rholder/gradle-one-jar
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.github.rholder:gradle-one-jar:1.0.3'
}
}
// Set our project variables
project.ext {
dropwizardVersion = '0.7.0'
}
repositories {
mavenCentral()
}
dependencies {
compile (
'io.dropwizard:dropwizard-core:' + dropwizardVersion,
'io.dropwizard:dropwizard-hibernate:' + dropwizardVersion,
'io.dropwizard:dropwizard-migrations:' + dropwizardVersion,
'io.dropwizard:dropwizard-auth:' + dropwizardVersion,
'com.h2database:h2:1.3.168'
)
testCompile group: 'junit', name: 'junit', version: '4.11'
}
// Configure the oneJar task
task oneJar(type: OneJar) {
mainClass = mainClassName
}
// Configure the run task to start the Dropwizard service
run {
args 'server', 'example.yml'
}
task wrapper(type: Wrapper) {
gradleVersion = '1.4'
}
artifacts {
oneJar
@spindelmanne
Copy link

Nice! It seems to be truncated, however.

@aschwabe
Copy link

aschwabe commented Dec 9, 2015

Looks like the only thing truncated is a closing brace "}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment