-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
150 lines (123 loc) · 4.56 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import org.gradle.internal.os.OperatingSystem
buildscript {
repositories {
mavenLocal()
jcenter()
maven { url "http://repo.spring.io/plugins-release" }
maven { url "https://plugins.gradle.org/m2/" }
// TODO To remove after final Spring Boot 2 release
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}"
classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:1.5.1"
}
}
plugins {
id "org.sonarqube" version "2.6.2" apply false
id "net.ltgt.apt-eclipse" version "0.15" apply false
id "net.ltgt.apt-idea" version "0.15" apply false
id "net.ltgt.apt" version "0.15" apply false
id "io.spring.dependency-management" version "1.0.3.RELEASE" apply false
id "com.moowork.node" version "1.2.0" apply false
}
subprojects { subproject ->
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
assert System.properties['java.specification.version'] == '1.8'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'propdeps'
apply plugin: 'net.ltgt.apt-eclipse'
apply plugin: 'net.ltgt.apt-idea'
apply plugin: 'net.ltgt.apt'
apply plugin: 'org.sonarqube'
apply plugin: 'io.spring.dependency-management'
test {
exclude '**/CucumberTest*'
// uncomment if the tests reports are not generated
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
// ignoreFailures true
reports.html.enabled = false
}
task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/tests")
reportOn test
}
repositories {
mavenLocal()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
jcenter()
// TODO To remove after final Spring Boot 2 release
maven { url "https://repo.spring.io/milestone" }
}
dependencyManagement {
imports {
mavenBom 'io.github.jhipster:jhipster-dependencies:' + jhipster_dependencies_version
}
}
// Configuration for spring-boot
if (subproject.name.endsWith("-web")) {
apply plugin: 'org.springframework.boot'
apply plugin: 'war'
apply plugin: 'com.moowork.node'
springBoot {
buildInfo()
}
if (OperatingSystem.current().isWindows()) {
// https://stackoverflow.com/questions/40037487/the-filename-or-extension-is-too-long-error-using-gradle
task classpathJar(type: Jar) {
dependsOn configurations.runtime
appendix = 'classpath'
doFirst {
manifest {
attributes 'Class-Path': configurations.runtime.files.collect {
it.toURI().toURL().toString().replaceFirst(/file:\/+/, '/').replaceAll(' ', '%20')
}.join(' ')
}
}
}
bootRun {
dependsOn classpathJar
doFirst {
classpath = files("$buildDir/classes/java/main", "$buildDir/resources/main", classpathJar.archivePath)
}
}
}
apply from: '../gradle/docker.gradle'
apply from: '../gradle/sonar.gradle'
apply from: '../gradle/liquibase.gradle'
if (project.hasProperty('prod')) {
apply from: '../gradle/profile_prod.gradle'
} else {
apply from: '../gradle/profile_dev.gradle'
}
if (project.hasProperty('graphite')) {
apply from: '../gradle/graphite.gradle'
}
if (project.hasProperty('prometheus')) {
apply from: '../gradle/prometheus.gradle'
}
task cleanResources(type: Delete) {
delete 'build/resources'
}
task stage(dependsOn: 'bootWar') {
}
if (project.hasProperty('nodeInstall')) {
node {
version = "${node_version}"
npmVersion = "${npm_version}"
yarnVersion = "${yarn_version}"
download = true
}
}
compileJava.dependsOn processResources
processResources.dependsOn cleanResources, bootBuildInfo
bootBuildInfo.mustRunAfter cleanResources
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
}