-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (107 loc) · 4.05 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
buildscript {
ext {
osisVersion = '2.2.5'
vaultclientVersion = '1.1.2'
springBootVersion = '2.7.6'
}
}
plugins {
id 'java'
id 'java-library'
id 'pmd'
id 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version '1.1.0'
id 'com.github.spotbugs' version '5.0.12'
id 'com.github.ksoichiro.console.reporter' version '0.6.3' // jacoco report (code coverage)
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' // gradle nexus publish-plugin
id 'org.owasp.dependencycheck' version '7.1.1'
}
dependencies {
implementation project('osis-app')
}
bootJar {
mainClass = 'com.scality.osis.Application'
}
jar {
classifier = ''
}
// to upload the bootJar instead of jar
configurations {
[apiElements, runtimeElements].each {
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
it.outgoing.artifact(bootJar)
}
}
allprojects {
group = 'com.scality'
sourceCompatibility = JavaVersion.VERSION_17
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.owasp.dependencycheck'
apply from: "$rootDir/spotbugs.gradle"
apply from: "$rootDir/pmd.gradle"
apply from: "$rootDir/jacoco.gradle"
apply from: "$rootDir/upload-artifact.gradle"
dependencies {
// vaultclient
implementation "com.scality:vaultclient:$vaultclientVersion"
// Spring boot
implementation "org.springframework.boot:spring-boot-starter-webflux:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-hateoas:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-security:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-data-redis:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
implementation 'org.springdoc:springdoc-openapi-ui:1.6.4'
implementation 'javax.validation:validation-api:2.0.1.Final'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.328'
implementation 'com.amazonaws:aws-java-sdk-sts:1.12.328'
implementation 'com.amazonaws:aws-java-sdk-iam:1.12.328'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
configurations {
version = "${osisVersion}"
if (!project.hasProperty('release')) {
project.setVersion(project.getVersion() + '-SNAPSHOT')
}
}
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
}
// task used by the gradle nexus publish-plugin
nexusPublishing {
repositories {
sonatype {
username = sonatypeUsername
password = sonatypePassword
}
}
}
// This task is in charge to set version and build date in the interface App of osis-core in order to avoid duplicated constants
task app {
doLast {
println "Set version number and build date in the interface 'App.java'"
ant.replaceregexp(file: 'osis-core/src/main/java/com/scality/osis/App.java', match: 'VERSION\\s*=\\s*".*"', replace: 'VERSION = "' + "${osisVersion}" + '"')
ant.replaceregexp(file: 'osis-core/src/main/java/com/scality/osis/App.java', match: 'DATE\\s*=\\s*\\d*[l,L]', replace: 'DATE = ' + new Date().getTime() + 'L')
File file = file('osis-core/src/main/java/com/scality/osis/App.java')
def lines = file.readLines()
lines.each { String line ->
println line
}
}
}
compileJava.dependsOn app