This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
forked from UniconLabs/cas4-services-management-overlay
-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
build.gradle
116 lines (98 loc) · 3.06 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
buildscript {
repositories {
mavenLocal()
jcenter()
gradlePluginPortal()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
classpath "io.freefair.gradle:maven-plugin:${project.gradleMavenPluginVersion}"
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
}
apply plugin: "io.freefair.war-overlay"
apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "eclipse"
apply plugin: "idea"
def casMgmtServerVersion = project.'casmgmt.version'
project.ext."casMgmtServerVersion" = casMgmtServerVersion
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
cacheDynamicVersionsFor 0, "seconds"
preferProjectModules()
}
}
war {
entryCompression = ZipEntryCompression.STORED
}
springBoot {
mainClassName = "org.apereo.cas.mgmt.web.CasManagementWebApplication"
}
bootWar {
if (project.hasProperty('executable')) {
launchScript()
}
archiveName "cas-management.war"
baseName "cas-management"
excludeDevtools = false
}
bootRun {
sourceResources sourceSets.main
classpath = sourceSets.main.runtimeClasspath
}
dependencies {
// Other CAS Management dependencies/modules may be listed here...
}
task run(group: "build", description: "Run the CAS managment web application in embedded container mode") {
dependsOn build
doLast {
def casRunArgs = Arrays.asList("-Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1".split(" "))
javaexec {
main = "-jar"
jvmArgs = casRunArgs
args = ["build/libs/cas-management.war"]
logger.info "Started ${commandLine}"
}
}
}
bootWar {
entryCompression = ZipEntryCompression.STORED
overlays {
// https://docs.freefair.io/gradle-plugins/current/reference/#_io_freefair_war_overlay
// Note: The "excludes" property is only for files in the war dependency.
// If a jar is excluded from the war, it could be brought back into the final war as a dependency
// of non-war dependencies. Those should be excluded via normal gradle dependency exclusions.
cas {
from "org.apereo.cas:cas-mgmt-webapp${project.appServer}:${casMgmtServerVersion}@war"
provided = false
excludes = []
}
}
}
task copyCasConfiguration(type: Copy, group: "build", description: "Copy the CAS configuration from this project to /etc/cas/config") {
from "etc/cas/config"
into new File('/etc/cas/config').absolutePath
doFirst {
new File('/etc/cas/config').mkdirs()
}
}