This repository has been archived by the owner on Nov 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
84 lines (68 loc) · 2.3 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
buildscript {
ext { springBootVersion = '1.4.3.RELEASE' }
repositories {
mavenCentral()
}
dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") }
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
jar {
baseName = 'demo'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
project.tasks.withType(JavaCompile) {
options.fork = true
options.compilerArgs << '-parameters'
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
configurations {
instrument {
description 'classpath for instrument as java agent'
}
}
dependencies {
// Tooling
compileOnly 'org.projectlombok:lombok:1.16.12'
instrument('org.springframework:spring-instrument')
// Database
compile("org.springframework.boot:spring-boot-starter-data-jpa") { exclude module: 'hibernate-entitymanager' }
compile 'org.eclipse.persistence:org.eclipse.persistence.jpa:2.6.4'
runtime("com.h2database:h2")
runtime 'mysql:mysql-connector-java'
// REST
runtime('org.springframework.data:spring-data-rest-hal-browser')
compile("org.springframework.boot:spring-boot-starter-data-rest")
runtime 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
// Util
compile 'com.google.guava:guava:20.0'
compile('com.fasterxml.uuid:java-uuid-generator:3.1.3')
// Testing
testCompile('org.springframework.boot:spring-boot-starter-test')
}
test { jvmArgs "-javaagent:$project.configurations.instrument.singleFile" }
bootRun {
jvmArgs "-javaagent:$project.configurations.instrument.singleFile"
systemProperties = System.properties
}
task copySpringInstrumentJar (type:Copy) {
description = 'Copies the spring-instrument.jar into your lib directory.'
outputs.file project.file('lib/spring-instrument.jar')
from (project.configurations.instrument)
into("lib")
rename { String filename -> filename = 'spring-instrument.jar' }
}
tasks.idea.dependsOn(project.tasks.copySpringInstrumentJar)
tasks.eclipse.dependsOn(project.tasks.copySpringInstrumentJar)
tasks.processResources.dependsOn(project.tasks.copySpringInstrumentJar)