forked from ow2-proactive/connector-iaas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
218 lines (182 loc) · 6.74 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.researchgate.release'
apply plugin: 'spring-boot'
apply plugin: 'war'
apply plugin: "sonar-runner"
apply from: "$rootDir/gradle/ext/coding-format.gradle"
// To embed into the release process. './gradlew' install will be called.
apply plugin: 'maven'
// Configure the maven repository deployment
install {
repositories.mavenInstaller {
// Set the version
pom.version = connectorIaaSVersion
// Set the group/namespace for the maven repository deployment.
pom.groupId = 'org.ow2.proactive'
}
}
repositories {
mavenCentral()
jcenter()
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
url "http://repository.activeeon.com/content/groups/proactive/"
}
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'org.postgresql:postgresql:9.3-1102-jdbc41'
classpath 'org.ajoberstar:gradle-jacoco:0.3.0'
classpath 'net.researchgate:gradle-release:2.2.1'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.1.RELEASE'
classpath "com.diffplug.gradle.spotless:spotless:2.4.0"
classpath "org.ow2.proactive:coding-rules:1.0.0"
delete "gradle/ext"
ant.unjar src: configurations.classpath.find { it.name.startsWith("coding-rules") }, dest: 'gradle/ext'
}
}
mainClassName = 'org.ow2.proactive.connector.iaas.ConnectorIaaSApp'
springBoot {
mainClass = mainClassName
}
// version is not set to make the war filename short and nice
war {
baseName = 'connector-iaas'
}
jar {
baseName = 'connector-iaas'
// Version is define in gradle.properties
version = connectorIaaSVersion
manifest {
attributes 'Main-Class': mainClassName
attributes 'Class-Path': "."
}
}
shadowJar {
mergeServiceFiles()
}
def jdkHome = System.getenv("JAVA_HOME")
release {
preTagCommitMessage = '[ci skip][Gradle Release Plugin] - pre tag commit: '
tagCommitMessage = '[ci skip][Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[ci skip][Gradle Release Plugin] - new version commit: '
}
configurations {
// Those modules are excluded to avoid clashes when embedded inside the ProActive Scheduler
all*.exclude module: 'spring-boot-starter-logging'
all*.exclude module: 'logback-core'
all*.exclude module: 'logback-classic'
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
dependencies {
// Lombok plugin to remove boilerplate code from project
compile 'org.projectlombok:lombok:1.16.6'
// Guava allows immutable classes/objects
compile 'com.google.guava:guava:19.0'
// Support for easy class to Json convertion and vice verca
compile group: 'com.aol.microservices', name:'micro-jackson-configuration', version:'0.79.5'
// For using the rest jersey annotations
compile 'org.springframework.boot:spring-boot-starter-jersey:1.3.1.RELEASE'
// The basic spring boot web 'packet' -- tomcat is excluded because this project will be embedded
// in ProActive Scheduler
compile('org.springframework.boot:spring-boot-starter-web:1.3.1.RELEASE') {
exclude module: "spring-boot-starter-tomcat"
}
// This allows log4j logging for spring boot. This dependency is needed for standalaone but will
// clash with the ProActive Scheduler dependencies when included. It is excluded in configurations above.
compile 'org.springframework.boot:spring-boot-starter-log4j2:1.3.1.RELEASE'
// Provides a standalone jetty server. It is providedCompile to be placed inside the provided folder
// in the war/jar. When a war is loaded, the jars in the provided folder are not loaded.
providedCompile 'org.springframework.boot:spring-boot-starter-jetty:1.3.1.RELEASE'
// Jcloud dependencies
compile ('org.apache.stratos:jclouds-compute:1.9.1'){
exclude module : 'jsr311-api'
}
compile ('org.apache.jclouds.api:openstack-nova:1.9.2'){
exclude module : 'jsr311-api'
}
compile ('org.apache.jclouds.provider:aws-ec2:1.9.1'){
exclude module : 'jsr311-api'
}
compile ('org.apache.jclouds.labs:docker:1.9.1'){
exclude module : 'jsr311-api'
}
// VMware dependency
compile 'com.toastcoders:yavijava:6.0.03'
// Json project
compile 'org.json:json:20151123'
// Imports for JUnit tests
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.28'
testCompile 'org.springframework.boot:spring-boot-starter-test:1.3.1.RELEASE'
testCompile 'com.jayway.restassured:rest-assured:2.8.0'
compile files("$jdkHome/lib/tools.jar")
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version:'1.1'
testCompile ('junit:junit:4.12') {
exclude module : 'hamcrest'
exclude module : 'hamcrest-core'
}
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
testCompile 'org.springframework:spring-test:2.5'
}
sourceSets {
test {
java.srcDir file('src/test/java')
resources.srcDir file('src/test/resources')
}
integTest {
java.srcDir file('src/integTest/java')
resources.srcDir file('src/integTest/resources')
}
}
task integTest(type: Test) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath = sourceSets.integTest.runtimeClasspath
}
dependencies {
integTestCompile sourceSets.main.output
integTestCompile configurations.testCompile
integTestCompile sourceSets.test.output
integTestRuntime configurations.testRuntime
}
task local {
run { systemProperty "spring.profiles.active", "local" }
}
allprojects {
apply plugin: "sonar-runner"
apply plugin: 'jacoco'
sonarRunner {
sonarProperties {
property "sonar.projectKey", "$project.group:connector-iaas"
property "sonar.projectName", "connector-iaas"
property "sonar.jdbc.driverClassName", "org.postgresql.Driver"
property "sonar.language", "java"
property "sonar.skipDesign" , "true"
property "sonar.sources", "src/main/java"
property 'sonar.jacoco.reportPath', "${buildDir}/jacoco/testDebug.exec"
property 'sonar.junit.reportsPath', "${buildDir}/test-results"
}
}
jacoco {
toolVersion = '0.7.1.201405082137'
}
jacocoTestReport {
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
}