forked from apereo/cas-overlay-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
146 lines (125 loc) · 4.68 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
import org.apache.tools.ant.taskdefs.condition.*
import org.gradle.internal.logging.text.*
import org.apereo.cas.metadata.*
import java.nio.file.*
import static org.gradle.internal.logging.text.StyledTextOutput.Style
buildscript {
repositories {
if (project.privateRepoUrl) {
maven {
url project.privateRepoUrl
credentials {
username = project.privateRepoUsername
password = System.env.PRIVATE_REPO_TOKEN
}
}
}
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
mavenContent { snapshotsOnly() }
}
maven {
url "https://repo.spring.io/milestone"
mavenContent { releasesOnly() }
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
classpath "io.freefair.gradle:maven-plugin:${project.gradleFreeFairPluginVersion}"
classpath "io.freefair.gradle:lombok-plugin:${project.gradleFreeFairPluginVersion}"
classpath "io.spring.gradle:dependency-management-plugin:${project.gradleDependencyManagementPluginVersion}"
classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}"
classpath "de.undercouch:gradle-download-task:${project.gradleDownloadTaskVersion}"
classpath "org.apereo.cas:cas-server-core-api-configuration-model:${project.'cas.version'}"
classpath "org.apereo.cas:cas-server-core-configuration-metadata-repository:${project.'cas.version'}"
}
}
repositories {
if (project.privateRepoUrl) {
maven {
url project.privateRepoUrl
credentials {
username = project.privateRepoUsername
password = System.env.PRIVATE_REPO_TOKEN
}
}
}
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/releases' }
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
mavenContent { snapshotsOnly() }
}
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
maven {
url "https://repo.spring.io/milestone"
mavenContent { releasesOnly() }
}
}
apply plugin: "io.freefair.war-overlay"
apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "io.freefair.lombok"
apply from: rootProject.file("gradle/springboot.gradle")
apply from: rootProject.file("gradle/jib.gradle")
apply from: rootProject.file("gradle/tasks.gradle")
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
cacheDynamicVersionsFor 0, "seconds"
preferProjectModules()
def failIfConflict = project.hasProperty("failOnVersionConflict") && Boolean.valueOf(project.getProperty("failOnVersionConflict"))
if (failIfConflict) {
failOnVersionConflict()
}
}
}
war {
entryCompression = ZipEntryCompression.STORED
enabled = false
}
sourceSets {
bootRunSources {
resources {
srcDirs new File("//etc/cas/templates/"), new File("${project.getProjectDir()}/src/main/resources/")
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(project.targetCompatibility)
}
}
bootBuildImage {
imageName = "${project.'containerImageOrg'}/${project.'containerImageName'}:${project.version}"
}
dependencies {
/**
* Do NOT modify the lines below or else you will risk breaking dependency management.
*/
implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
/**
* CAS dependencies and modules may be listed here.
*
* There is no need to specify the version number for each dependency
* since versions are all resolved and controlled by the dependency management
* plugin via the CAS bom.
**/
implementation "org.apereo.cas:cas-server-core-api-configuration-model"
implementation "org.apereo.cas:cas-server-webapp-init"
if (project.hasProperty("casModules")) {
def dependencies = project.getProperty("casModules").split(",")
dependencies.each {
def projectsToAdd = rootProject.subprojects.findAll {project ->
project.name == "cas-server-core-${it}" || project.name == "cas-server-support-${it}"
}
projectsToAdd.each {implementation it}
}
}
developmentOnly "org.springframework.boot:spring-boot-devtools:${project.springBootVersion}"
}