-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
126 lines (111 loc) · 3.42 KB
/
build.gradle
File metadata and controls
126 lines (111 loc) · 3.42 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'nebula.ospackage-base'
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE"
classpath 'com.netflix.nebula:gradle-ospackage-plugin:3.1.0'
}
}
jar {
baseName = 'restapp'
version = '0.1.0'
}
springBoot {
// Allows us to run the jar directly from the command line, e.g. ./springboot-0.0.1.jar
executable = true
// Excludes the devtools package from production builds
excludeDevtools = true
// Set values for variable placeholders
// in the default launch script.
embeddedLaunchScriptProperties = [useStartStopDaemon: 'false']
}
repositories {
mavenCentral()
jcenter()
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
//sourceCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web"){
exclude module: "spring-boot-starter-tomcat"
}
compile 'org.apache.tomcat.embed:tomcat-embed-core:7.0.59'
compile 'org.apache.tomcat.embed:tomcat-embed-el:7.0.59'
compile 'org.apache.tomcat.embed:tomcat-embed-logging-juli:7.0.59'
compile 'org.apache.tomcat.embed:tomcat-embed-websocket:7.0.59'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.oauth-client:google-oauth-client:1.22.0'
compile 'com.google.http-client:google-http-client-jackson2:1.22.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.22.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.google.apis:google-api-services-monitoring:v3-rev10-1.22.0'
compile 'com.google.apis:google-api-services-compute:v1-rev105-1.20.0'
compile 'joda-time:joda-time:2.9.4'
compile 'com.google.code.gson:gson:2.7'
//compile group: 'postgresql', name: 'postgresql', version: '9.1-901-1.jdbc4'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'com.jayway.jsonpath:json-path'
compile 'javax.xml.bind:jaxb-api:2.3.0'
}
task fatJar(type: Jar) {
manifest {
attributes( 'Main-Class': 'hello.Application' )
}
baseName = 'restapp' + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task packDeb(type: Deb, dependsOn: bootRepackage) {
packageName = 'restapp'
version = 1.0
requires('openjdk-7-jre-headless')
//requires('openjdk-8-jre-headless')
//requires('openjdk-8-jdk')
//requires('java')
from('build/libs/.') {
into "/opt/restapp"
}
postInstall = file('pkg_scripts/deb/postInstall.sh')
from(jar.outputs.files) {
into 'lib'
}
from('build/scripts') {
into 'bin'
fileMode = 0550
}
from(configurations.runtime) {
into 'lib'
}
}
task packRpm(type: Rpm, dependsOn: bootRepackage) {
packageName = 'restapp'
version = '1.0'
release = '1'
os = LINUX
requires('java')
from('build/libs/.') {
into "/opt/restapp"
}
postInstall = file('pkg_scripts/rpm/postInstall.sh')
preUninstall = file('pkg_scripts/rpm/preUninstall.sh')
postUninstall = file('pkg_scripts/rpm/postUninstall.sh')
from(jar.outputs.files) {
into 'lib'
}
from('build/scripts') {
into 'bin'
fileMode = 0550
}
from(configurations.runtime) {
into 'lib'
}
}