Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 115 lines (95 sloc) 3.42 KB
group 'cristina.tech'
version '1.0.0-SNAPSHOT'
repositories {
mavenCentral()
}
buildscript {
ext {
springBootVersion = '1.5.2.RELEASE'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1") //Send coverage data to coveralls.io
classpath('se.transmode.gradle:gradle-docker:1.2') //Build a Docker Image with Gradle
}
}
//Docker image name (or tag) is set up from the jar file properties: cristinatech/open-travel-spring-boot-docker
group = 'cristinatech'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'docker'
jar {
baseName = 'open-travel-spring-boot-docker'
version = '1.0.0-SNAPSHOT'
}
// copy the DockerFile into the build/libs folder
build.doLast() {
copy {
from 'src/main/docker'
into 'build/libs'
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator') //Production ready features to help you monitor and manage your application
compile('org.springframework.boot:spring-boot-starter-data-jpa') //Java Persistence API including spring-data-jpa, spring-orm and Hibernate
compile('org.springframework.boot:spring-boot-starter-data-rest') //Exposing Spring Data repositories over REST via spring-data-rest-webmvc
compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310') //Instruct Jackson JSON serializer/deserializer to work with Java 8 Date & Time API
compileOnly('org.projectlombok:lombok:1.16.16') //Gets rid of boiler plate code in Entity, POJOs, Data Objects
testCompile('org.springframework.boot:spring-boot-starter-test') //Imports both Spring Boot test modules as well has JUnit, AssertJ, Hamcrest, Mockito, JSONassert, JsonPath 
runtime('org.springframework.data:spring-data-rest-hal-browser') //Browsing Spring Data REST repositories in your browser
runtime('org.flywaydb:flyway-core') //Flyway Database Migrations library
runtime('org.postgresql:postgresql') //PostgreSQL jdbc driver
runtime('com.zaxxer:HikariCP') //high-performance, production-quality JDBC connection pool
testRuntime('com.h2database:h2') //H2 in-memory database for tests (with embedded support)
}
jacoco {
toolVersion = "0.7.9"
}
test {
jacoco {
append = false
destinationFile = file("$buildDir/jacoco.exec")
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
build.dependsOn jacocoTestReport
coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
task wrapper(type: Wrapper) {
gradleVersion = '3.4.1'
}
tasks.coveralls {
onlyIf { System.env.'CI' }
}
task buildDocker(type: Docker, dependsOn: build) {
push = false
applicationName = jar.baseName
dockerfile = file('src/main/docker/Dockerfile')
doFirst {
copy {
from jar
into stageDir
}
}
}