-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
93 lines (85 loc) · 2.22 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
85
86
87
88
89
90
91
92
93
/**
* Buildscript customization
*
* This part defines tools for your build script. In this case it will find spring-boot-gradle-plugin from
* mavenCentral() artifact repository and allow you to apply spring-boot plugin to your application.
*/
buildscript {
ext {
springBootVersion = '1.3.2.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
/**
* Application build customization
*
* This part customizes how your Java application is built.
*
* apply plugin: 'java'
* Means it's a Java application. It will enable default tasks with default configuration.
* E.g.: build, assemble, jar, javadoc, test
*/
apply plugin: 'java'
// adds spring boot related tasks like "bootRun"
apply plugin: 'spring-boot'
/**
* Configuring a build task
*
* The following snippet configures your jar task.
* This means when you launch "gradlew jar*" these will override the default values for your
* java ar
*
* * Java™ Archive (JAR) is a container that includes your resource files, your compiled .class files and anything else
* your application needs. Is often referred to as "artifact".
*/
jar {
baseName = 'peanuts'
version = '0.0.1-SNAPSHOT'
}
/**
* Java compiler options
*/
sourceCompatibility = 1.7
targetCompatibility = 1.7
/**
* Defines artifact repository. In other words, a location where to look for JARs
*/
repositories {
mavenCentral()
}
/**
* Application dependencies
*
* These define your classpath. Allows you to write all spring specific things like @RestController, @RequestMapping etc.
*/
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
/**
* Configure gradle wrapper. Read more:
* https://docs.gradle.org/current/userguide/gradle_wrapper.html
*/
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
/**
* IDE specific configuration
*
* This part will allow us to automatically reload the freshly built files
* so you don't have to restart "gradlew bootRun" every time you change code.
*
*
*/
apply plugin: 'idea'
idea {
module {
inheritOutputDirs = false
outputDir = file("$buildDir/classes/main/")
}
}