Skip to content

Commit

Permalink
remove tomcat-version from the build (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed authored Nov 17, 2023
1 parent a059a73 commit 439260c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
13 changes: 13 additions & 0 deletions app/src/main/resources/common/gradle/build.gradle.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ configurations {
if (failIfConflict) {
failOnVersionConflict()
}

if (project.hasProperty("tomcatVersion")) {
eachDependency { DependencyResolveDetails dependency ->
def requested = dependency.requested
if (requested.group.startsWith("org.apache.tomcat") && requested.name != "jakartaee-migration") {
dependency.useVersion("${tomcatVersion}")
}
}
}
}
exclude(group: "cglib", module: "cglib")
exclude(group: "cglib", module: "cglib-full")
Expand Down Expand Up @@ -463,6 +472,10 @@ dependencies {
implementation "org.apereo.cas:cas-server-core-api-configuration-model"
implementation "org.apereo.cas:cas-server-webapp-init"

if (project.hasProperty("appServer")) {
implementation "org.apereo.cas:cas-server-webapp-init${project.appServer}"
}

developmentOnly "org.springframework.boot:spring-boot-devtools:${project.springBootVersion}"
{{/nativeImageSupported}}
{{/casServer}}
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/resources/common/gradle/gradle.properties.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ gradleGraalVmNativePluginVersion=@gradleGraalVmNativePluginVersion@
# and want to set up, download and manage the container (i.e. Apache Tomcat) yourself.
appServer={{appServer}}

# If you are using an embedded Apache Tomcat container to deploy and run CAS,
# and need to override the Apache Tomcat version, uncomment the property below
# and specify the the Apache Tomcat version, i.e. {{tomcatVersion}}.
# While enabled, this will override any and all upstream changes to
# Apache Tomcat dependency management and you will be directly responsible to make
# adjustments and upgrades as necessary. Use with caution, favor less work.
# tomcatVersion={{tomcatVersion}}

# Settings to generate keystore
# used by the build to assist with creating
# self-signed certificates for https endpoints
Expand All @@ -78,8 +86,6 @@ gradleOpenRewritePluginVersion=@gradleOpenRewritePluginVersion@
{{/openRewriteSupported}}
{{/casServer}}

tomcatVersion={{tomcatVersion}}

# Include private repository
# override these in user properties or pass in values from env on command line
privateRepoUrl=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ if (!nativeImage) {
{{/configServer}}

provided = false
excludes = ["WEB-INF/lib/servlet-api-2*.jar"]

def excludeArtifacts = ["WEB-INF/lib/servlet-api-2*.jar"]
if (project.hasProperty("tomcatVersion")) {
excludes += ["WEB-INF/lib/tomcat-*.jar"]
}
excludes = excludeArtifacts

/*
excludes = ["WEB-INF/lib/somejar-1.0*"]
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/resources/common/gradle/tasks.gradle.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ task copyCasConfiguration(type: Copy, group: "CAS",

{{#casServer}}

def tomcatDirectory = "${buildDir}/apache-tomcat-${tomcatVersion}"
project.ext."tomcatDirectory" = tomcatDirectory

def explodedDir = "${buildDir}/app"
def explodedResourcesDir = "${buildDir}/cas-resources"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,4 @@ recipeList:
key: jibVersion
value: {{jibVersion}}
overwrite: true
filePattern: 'gradle.properties'
- org.openrewrite.gradle.AddProperty:
key: tomcatVersion
value: {{tomcatVersion}}
overwrite: true
filePattern: 'gradle.properties'
filePattern: 'gradle.properties'

0 comments on commit 439260c

Please sign in to comment.