/
build.gradle
167 lines (137 loc) · 4.01 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
/*
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'com.cinnober.gradle', name: 'semver-git', version: '2.3.1'
classpath 'org.owasp:dependency-check-gradle:3.2.0'
}
}
*/
plugins {
// code
id 'java'
// code quality
id 'jacoco'
id "org.owasp.dependencycheck" version "5.3.2.1"
// IDEs
id 'eclipse'
id 'idea'
// publishing
id "com.cinnober.gradle.semver-git" version "3.0.0"
id 'maven-publish'
// detecting new dependency versions
id 'com.github.ben-manes.versions' version '0.28.0' // find new versions of dependency task: dependencyUpdates
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
// dependencies section
repositories {
mavenCentral()
jcenter()
}
configurations {
keystoreJar {
extendsFrom(compile)
exclude(module:'bcprov-jdk15on')
}
}
dependencies {
compile('io.jsonwebtoken:jjwt-api:0.11.1')
compile('io.jsonwebtoken:jjwt-impl:0.11.1')
compile('io.jsonwebtoken:jjwt-jackson:0.11.1')
compile('org.bouncycastle:bcprov-jdk15on:[1.60, 1.999]')
compile('org.bouncycastle:bcpkix-jdk15on:[1.60, 1.999]')
compile('io.github.openfeign:feign-jackson:[9.7.0, 9.999]')
compile('commons-logging:commons-logging:[1.2, 1.999]')
// JDK 11 runtime fixes
compile('javax.xml.bind:jaxb-api:[2.3.0, 2.3.999]')
runtime('org.glassfish.jaxb:jaxb-runtime:[2.3.0, 2.3.999]')
// spring dependencies
compile('org.springframework.data:spring-data-commons:2.2.7.RELEASE')
compile('org.springframework:spring-web:5.2.6.RELEASE')
// common testing
testCompile('junit:junit:[4.12, 4.999]')
testCompile('org.powermock:powermock-api-mockito2:[2.0, 2.999]')
testCompile('org.powermock:powermock-core:[2.0, 2.999]')
testCompile('org.powermock:powermock-module-junit4:[2.0, 2.999]')
}
// sources and javadocs
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
task generateJavaDocs(type: Javadoc) {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
destinationDir = reporting.file("javadocs")
}
task javadocJar(type: Jar, dependsOn: generateJavaDocs) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// hack to make the @apiNote not break the build...
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
task buildRunnableServiceKeystoreFactoryJAR(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Build Runnable Service Keystore Factory JAR',
'Implementation-Version': version,
'Main-Class': 'eu.h2020.symbiote.security.helpers.ServiceAAMCertificateKeyStoreFactory'
}
baseName = project.name + '-helper'
from { configurations.keystoreJar.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
with jar
}
artifacts {
archives sourceJar
archives javadocJar
archives buildRunnableServiceKeystoreFactoryJAR
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'eu.h2020.symbiote'
version = project.version
from components.java
artifact sourceJar {
classifier "sources"
}
artifact javadocJar
artifact buildRunnableServiceKeystoreFactoryJAR {
classifier "helper"
}
}
}
}
// code quality below
// jacoco configuration section
jacoco {
toolVersion = "0.8.5"
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
test {
testLogging {
exceptionFormat = 'full'
}
}
// owasp config
dependencyCheck {
outputDirectory = file("$rootDir/build/reports/security")
}
// including code quality extensions into the build
check.dependsOn(jacocoTestReport)//, 'dependencyCheckAnalyze')