/
build.gradle
198 lines (163 loc) · 5.83 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
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = 'eu.h2020.symbiote.ResourceAccessProxyApplication'
}
// initial extensions to gradle
buildscript {
ext {
springBootVersion = '1.5.18.RELEASE'
springCloudVersion = 'Edgware.SR5'
}
repositories {
mavenCentral()
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:1.0.0.RELEASE"
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath group: 'com.cinnober.gradle', name: 'semver-git', version: '2.2.1'
classpath 'org.owasp:dependency-check-gradle:1.4.5.1'
}
}
// code
apply plugin: "io.spring.dependency-management"
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
// code quality
apply plugin: 'jacoco'
apply plugin: 'org.owasp.dependencycheck'
// IDEs
apply plugin: 'eclipse'
apply plugin: 'idea'
// publishing
apply plugin: 'com.cinnober.gradle.semver-git'
apply plugin: 'maven-publish'
// XXX please change with your commits according to http://semver.org/
project.group = 'eu.h2020.symbiote'
sourceCompatibility = 1.8
targetCompatibility = 1.8
// dependencies section
repositories {
mavenLocal()
mavenCentral()
maven { url "https://jitpack.io" }
}
// Spring related configs
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
/*
Forces dependencies' cache invalidation for each build for dependencies marked with
{ changing = true }
e.g.
compile('com.github.symbiote-h2020:SymbIoTeLibraries:develop-SNAPSHOT'){ changing = true }
*/
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
/* SymbIoTeLibraries manual:
One can use the library from jitpack by default with the notation:
compile('com.github.symbiote-h2020:SymbIoTeLibraries:develop-SNAPSHOT') {changing = true }
or having cloned locally the SymbIoTeLibraries repo use it directly with project dependency by:
compile project(':SymbIoTeLibraries')
Important --- In order to use the latter you need to:
1) switch comments on the artifact and project dependencies
2) always have only one uncommented
3) project dependency requires changes in settings.gradle file in this project
4) never commit build.gradle which has project dependencies active as it will break CI builds
*/
// localMaven
compile('com.github.symbiote-h2020:SymbIoTeLibraries:5.37+') { changing = true }
// Spring
compile('org.springframework.cloud:spring-cloud-starter')
compile('org.springframework.cloud:spring-cloud-starter-config')
compile('org.springframework.retry:spring-retry')
compile('org.springframework.boot:spring-boot-starter-aop')
compile('org.springframework.cloud:spring-cloud-starter-eureka')
compile('org.springframework.cloud:spring-cloud-starter-zipkin')
compile('org.springframework.boot:spring-boot-starter-amqp')
compile('org.springframework.boot:spring-boot-starter-data-rest')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-data-mongodb')
// OData
compile("org.apache.olingo:odata-commons-api:${'4.3.0'}")
compile("org.apache.olingo:odata-commons-core:${'4.3.0'}")
compile("org.apache.olingo:odata-server-api:${'4.3.0'}")
compile("org.apache.olingo:odata-server-core:${'4.3.0'}")
// Websocket
compile("org.springframework.boot:spring-boot-starter-websocket")
// Others
compile("com.jayway.jsonpath:json-path:2.4.0")
// test only
compile("org.springframework.boot:spring-boot-starter-web")
testCompile ("org.springframework.boot:spring-boot-starter-test")
// lombok
compileOnly('org.projectlombok:lombok')
//Owlapi
//compile('net.sourceforge.owlapi:owlapi-distribution:5.1.1')
compile('net.sourceforge.owlapi:owlapi-contract:5.1.1')
compile('net.sourceforge.owlapi:owlapi-util:3.3')
}
// publication
bootRepackage {
classifier = 'run'
}
jar {
baseName = 'ResourceAccessProxy'
version = project.version
}
task generateJavaDocs(type: Javadoc) {
source = sourceSets.main.allJava
classpath = project.sourceSets.main.compileClasspath
destinationDir = reporting.file("javadocs")
}
task javadocJar(type: Jar, dependsOn: generateJavaDocs) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = project.group
version = project.version
from components.java
artifact sourceJar {
classifier "sources"
}
artifact javadocJar
artifact(file("$libsDir/$project.name-$project.version-${bootRepackage.classifier}.jar")) {
classifier "run"
}
}
}
}
publishToMavenLocal.dependsOn(bootRepackage)
// code quality below
// jacoco configuration section
jacoco {
toolVersion = "0.7.9"
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
// owasp config
dependencyCheck {
outputDirectory = "build/reports/security"
}
// including code quality extensions into the build
check.dependsOn(jacocoTestReport) //, 'dependencyCheck')