-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
164 lines (150 loc) · 6.12 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
plugins {
id 'java'
// id 'war'
id 'maven-publish'
id "org.springframework.boot" version "2.7.17"
id "com.microsoft.azure.azurewebapp" version "1.2.0"
}
ext {
springBootVersion = '2.7.17'
springSecurityVersion = '3.0.4.RELEASE'
jacksonVersion = '2.13.0'
springdocOpenApiVersion = '1.7.0'
junitVersion = '4.12'
junitJupiterVersion = '5.7.0'
junitPlatformVersion = '1.7.1'
mockitoVersion = '4.11.0'
}
repositories {
mavenLocal()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-security:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-mail:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-tomcat:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
implementation "org.apache.commons:commons-email:1.4"
implementation "com.google.guava:guava:30.1.1-jre"
implementation "com.h2database:h2:1.4.197"
implementation "org.passay:passay:1.5.0"
implementation "org.springdoc:springdoc-openapi-ui:${springdocOpenApiVersion}"
implementation "org.springdoc:springdoc-openapi-security:${springdocOpenApiVersion}"
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.module:jackson-module-parameter-names:${jacksonVersion}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jacksonVersion}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
implementation "com.twilio.sdk:twilio:8.17.0"
implementation "org.apache.httpcomponents:httpclient:4.5.12"
implementation "io.jsonwebtoken:jjwt:0.9.1"
implementation "org.apache.maven.wagon:wagon-http:3.4.1"
implementation "com.github.cliftonlabs:json-simple:2.3.1"
implementation "org.springframework.boot:spring-boot-devtools:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-log4j2"
implementation "org.apache.tika:tika-core:1.18"
implementation "org.json:json:20201115"
implementation(platform("org.apache.logging.log4j:log4j-bom:2.17.1"))
modules {
module("org.springframework.boot:spring-boot-starter-logging") {
replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "Use Log4j2 instead of Logback")
}
}
implementation "org.mockito:mockito-bom:${mockitoVersion}"
implementation "org.hibernate.validator:hibernate-validator:6.1.0.Final"
testImplementation "org.hibernate.validator:hibernate-validator:6.1.0.Final"
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}") {
exclude group: "com.vaadin.external.google", module:"android-json"
}
testImplementation "junit:junit:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}"
testImplementation "org.junit.platform:junit-platform-engine:${junitPlatformVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junitJupiterVersion}"
testRuntimeOnly "org.junit.platform:junit-platform-commons:${junitPlatformVersion}"
testRuntimeOnly "org.codehaus.groovy:groovy:3.0.8"
}
apply plugin: 'io.spring.dependency-management'
def props = new Properties()
def propertiesFile = project.file('.env')
if (!propertiesFile.exists()) {
props.setProperty('APP_NAME', 'iwa-api')
Writer writer = new FileWriter(propertiesFile, false)
props.store(writer, "Change these variables to relevant values. Don't commit this file to source control.")
writer.close()
}
props.load(propertiesFile.newDataInputStream())
project.archivesBaseName = 'iwa-api'
group = 'com.opentext.example'
version = ''
description = 'IWA-API- An insecure Sptring Boot/Java REST API for use in Fortify demonstrations'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceSets {
test {
java {
srcDirs = ["src/test"]
}
}
}
azurewebapp {
subscription = props.getProperty("AZURE_SUBSCRIPTION_ID") // e.g. '17d2722b-256e-47e5-84b8-5b01f509a42c'
resourceGroup = props.getProperty("AZURE_RESOURCE_GROUP") // e.g. 'iwa-fortify-rg'
appName = props.getProperty("AZURE_APP_NAME") // e.g. 'fortify-iwa-app'
pricingTier = 'B1'
region = props.getProperty("AZURE_REGION") // e.g. 'eastus'
runtime {
//os = 'Windows'
os = 'Linux'
webContainer = 'Tomcat 9.0'
//webContainer = 'Java SE'
javaVersion = 'Java 1.8'
}
appSettings {
key1=value1
}
auth {
type = 'azure_cli' // support azure_cli, oauth2, device_code and service_principal
}
}
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
test {
useJUnitPlatform()
exclude {
'**/EncryptedPasswordUtilsTest.class'
}
reports {
junitXml.enabled = true
html.enabled = true
}
}
bootJar {
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}
bootRun {
systemProperty "spring.profiles.active", "default,dev"
}
task writeClasspath() {
doLast() {
buildDir.mkdirs()
def files = configurations.compileClasspath.getFiles().sort()
new File(buildDir, "classpath.txt").text = files.collect { it.path }.join(';')
//files.forEach{ f -> print("$f.path;")}
}
}