Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SHIBUI-2264
Update to gradle builds to centralize the versions into the properties so that the various builds are using the same versions and to ease future updates
  • Loading branch information
chasegawa committed Jun 8, 2022
1 parent 043f04b commit c51234a
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 47 deletions.
49 changes: 26 additions & 23 deletions backend/build.gradle
@@ -1,11 +1,11 @@
plugins {
id 'groovy'
id 'war'
id 'org.springframework.boot' version '2.5.12'
id 'com.gorylenko.gradle-git-properties' version '1.4.21'
id 'io.freefair.lombok' version '5.3.0'
id 'com.palantir.docker' version '0.28.0'
id 'com.palantir.docker-run' version '0.28.0'
id "groovy"
id "war"
id "org.springframework.boot"
id "io.freefair.lombok"
id "com.gorylenko.gradle-git-properties" version "1.4.21"
id "com.palantir.docker" version "0.28.0"
id "com.palantir.docker-run" version "0.28.0"
}

apply plugin: 'io.spring.dependency-management'
Expand All @@ -24,13 +24,16 @@ repositories {
url 'https://build.shibboleth.net/nexus/content/groups/public'
artifactUrls = ['https://build.shibboleth.net/nexus/content/repositories/thirdparty-snapshots']
}
maven { // for the springboot plugin
url "https://plugins.gradle.org/m2/"
}
mavenLocal()
mavenCentral()
}

configurations.all {
resolutionStrategy {
force 'org.cryptacular:cryptacular:1.1.3'
force "org.cryptacular:cryptacular:${project.'cryptacularVersion'}"

eachDependency { details ->
if (details.requested.group == 'org.seleniumhq.selenium' && details.requested.name != 'htmlunit-driver') {
Expand Down Expand Up @@ -110,7 +113,7 @@ bootWar {
}

springBoot {
mainClassName = 'edu.internet2.tier.shibboleth.admin.ui.ShibbolethUiApplication'
mainClass = 'edu.internet2.tier.shibboleth.admin.ui.ShibbolethUiApplication'
buildInfo()
}

Expand All @@ -119,7 +122,7 @@ generateLombokConfig.enabled = false
dependencies {
// opensaml deps
['opensaml-saml-api', 'opensaml-saml-impl', 'opensaml-xmlsec-api', 'opensaml-xmlsec-impl'].each {
compile "org.opensaml:${it}:${project.'opensaml.version'}"
compile "org.opensaml:${it}:${project.'opensamlVersion'}"
}

runtimeOnly "org.bouncycastle:bcprov-jdk15on:1.70"
Expand All @@ -129,31 +132,31 @@ dependencies {

// shibboleth idp deps
['idp-profile-spring', 'idp-profile-api'].each {
compile "net.shibboleth.idp:${it}:${project.'shibboleth.version'}"
compile "net.shibboleth.idp:${it}:${project.'shibbolethVersion'}"
}

// hibernate deps
['hibernate-core'].each {
compile "org.hibernate:${it}:${project.'hibernate.version'}"
compile "org.hibernate:${it}:${project.'hibernateVersion'}"
}

// spring boot auto-config starters
['starter-web', 'starter-data-jpa', 'starter-security', 'starter-actuator', 'devtools', 'starter-webflux', 'starter-thymeleaf', 'starter-mail', 'starter-validation'].each {
compile "org.springframework.boot:spring-boot-${it}"
}
// To override older version with security issue - https://www.lunasec.io/docs/blog/log4j-zero-day/
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.17.2'
implementation 'org.apache.logging.log4j:log4j-api:2.17.2'
implementation "org.apache.logging.log4j:log4j-to-slf4j:${project.'log4JVersion'}"
implementation "org.apache.logging.log4j:log4j-api:${project.'log4JVersion'}"

// TODO: figure out what this should really be
runtimeOnly 'org.springframework.boot:spring-boot-starter-tomcat:2.6.7'
runtimeOnly "org.springframework.boot:spring-boot-starter-tomcat:${project.'springbootVersion'}"

//Spring Configuration Annotation Processor - makes IntelliJ happy about @ConfigurationProperties
compileOnly 'org.springframework.boot:spring-boot-configuration-processor:2.6.7'
compileOnly "org.springframework.boot:spring-boot-configuration-processor:${project.'springbootVersion'}"

// lucene deps
['core', 'analyzers-common', 'queryparser'].each {
compile "org.apache.lucene:lucene-${it}:${project.'lucene.version'}"
compile "org.apache.lucene:lucene-${it}:${project.'luceneVersion'}"
}

compile "org.liquibase:liquibase-core"
Expand Down Expand Up @@ -181,8 +184,8 @@ dependencies {
testImplementation "org.spockframework:spock-core"
testImplementation "org.spockframework:spock-spring"

testCompile 'org.springframework.boot:spring-boot-starter-test:2.6.7'
testCompile 'org.springframework.security:spring-security-test:5.6.3'
testCompile "org.springframework.boot:spring-boot-starter-test:${project.'springbootVersion'}"
testCompile "org.springframework.security:spring-security-test:${project.'springSecurityVersion'}"
testCompile 'org.skyscreamer:jsonassert:1.5.0'
testCompile "org.xmlunit:xmlunit-core:2.5.1"
testRuntime 'cglib:cglib-nodep:3.2.5'
Expand All @@ -201,18 +204,18 @@ dependencies {
integrationTestCompile configurations.compile
integrationTestCompile 'com.saucelabs:sebuilder-interpreter:1.0.6'
integrationTestCompile 'jp.vmi:selenese-runner-java:3.20.0'
integrationTestCompile 'org.springframework.boot:spring-boot-starter-test:2.6.7'
integrationTestCompile 'org.springframework.security:spring-security-test:5.6.3'
integrationTestCompile "org.springframework.boot:spring-boot-starter-test:${project.'springbootVersion'}"
integrationTestCompile "org.springframework.security:spring-security-test:${project.'springSecurityVersion'}"

// CSV file support
compile 'com.opencsv:opencsv:4.4', {
exclude group: 'commons-collections'
}

compile 'org.apache.commons:commons-collections4:4.3'
compile "org.apache.commons:commons-collections4:${project.'commonsCollections4Version'}"

// Envers for persistent entities versioning
compile 'org.hibernate:hibernate-envers'
compile "org.hibernate:hibernate-envers:${project.'hibernateVersion'}"

//Pacj4 sub-project
runtimeOnly project(':pac4j-module')
Expand Down
7 changes: 5 additions & 2 deletions beacon/core/build.gradle
@@ -1,7 +1,7 @@
import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id 'org.springframework.boot' version '2.5.12' apply false
id 'org.springframework.boot'
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
id 'groovy'
}
Expand All @@ -11,6 +11,9 @@ targetCompatibility = 11

repositories {
jcenter()
maven { // for the springboot plugin
url "https://plugins.gradle.org/m2/"
}
}

dependencyManagement {
Expand All @@ -20,7 +23,7 @@ dependencyManagement {
}

dependencies {
testCompile "org.springframework.boot:spring-boot-starter-test:2.6.7"
testCompile "org.springframework.boot:spring-boot-starter-test:${project.'springbootVersion'}"
compile 'org.codehaus.groovy:groovy-all:3.0.10'
testImplementation platform("org.spockframework:spock-bom:2.1-groovy-3.0")
testImplementation "org.spockframework:spock-core"
Expand Down
5 changes: 4 additions & 1 deletion beacon/spring/build.gradle
@@ -1,7 +1,7 @@
import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id 'org.springframework.boot' version '2.5.12' apply false
id 'org.springframework.boot'
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
}

Expand All @@ -11,6 +11,9 @@ targetCompatibility = 11

repositories {
jcenter()
maven { // for the springboot plugin
url "https://plugins.gradle.org/m2/"
}
}

jar {
Expand Down
36 changes: 27 additions & 9 deletions gradle.properties
Expand Up @@ -2,19 +2,37 @@ name=shibui
group=edu.internet2.tier.shibboleth.admin.ui
version=1.11.0-SNAPSHOT

shibboleth.version=4.2.1
opensaml.version=4.2.0

spring-boot.version=2.5.12

hibernate.version=5.5.0.Final

lucene.version=8.1.1
### library versions
commonsCollections4Version=4.4
cryptacularVersion=1.2.4
hibernateVersion=5.5.0.Final
#hibernateVersion=5.6.9.Final
luceneVersion=8.1.1
log4JVersion=2.17.2
lombokVersion=5.3.3.3
opensamlVersion=4.2.0
pac4JVersion=5.4.3
pac4jSpringSecurityVersion=7.0.3
shibbolethVersion=4.2.1
springbootVersion=2.5.12
#springbootVersion=2.7.0
springSecurityVersion=5.6.3
# springSecurityVersion=5.7.1

org.gradle.jvmargs=-Xmx1g -XX:-UseGCOverheadLimit

# set token in personal global
i2.github.token=
i2.github.owner=TIER
i2.github.repo=shib-idp-ui
i2.github.apiEndpoint=https://github.internet2.edu/api/v3
i2.github.apiEndpoint=https://github.internet2.edu/api/v3

## NOTES
# pac4j spring security 7.0.3 here uses the pac4j 5.4.3 core, thus differences in versions (they used use the same versions, now
# keeping them in sync takes paying attention
#
# Springboot 2.7.0 and Hibernate 5.6.9 are current, but don't like all the columns named "value" in the db (along with H2), so don't
# update to these versions until ready to migrate the database columns. (the tests fail under these versions because the test database
# doesn't work).
#
# Additionally, springbootsecurity for tests doesn't like 5.7.1
25 changes: 14 additions & 11 deletions pac4j-module/build.gradle
@@ -1,9 +1,9 @@
plugins {
id 'groovy'
id 'jacoco'
id 'org.springframework.boot' version '2.5.12' apply false
id 'org.springframework.boot'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
id 'io.freefair.lombok' version '5.3.0'
id 'io.freefair.lombok'
}

sourceCompatibility = 11
Expand All @@ -16,6 +16,9 @@ repositories {
url 'https://build.shibboleth.net/nexus/content/groups/public'
artifactUrls = ['https://build.shibboleth.net/nexus/content/repositories/thirdparty-snapshots']
}
maven { // for the springboot plugin
url "https://plugins.gradle.org/m2/"
}
}

test {
Expand All @@ -33,24 +36,24 @@ generateLombokConfig.enabled = false
dependencies {
compileOnly project(':backend')

compile 'org.pac4j:spring-security-pac4j:7.0.3'
// pac4j is "off" - spring security 7.0.3 here uses the pac4j 5.4.3 core, thus differences in versions
compile 'org.pac4j:pac4j-core:5.4.3'
compile 'org.pac4j:pac4j-http:5.4.3'
compile 'org.pac4j:pac4j-saml:5.4.3', {
compile "org.pac4j:spring-security-pac4j:${project.'pac4jSpringSecurityVersion'}"
compile "org.pac4j:pac4j-core:${project.'pac4JVersion'}"
compile "org.pac4j:pac4j-http:${project.'pac4JVersion'}"
compile "org.pac4j:pac4j-saml:${project.'pac4JVersion'}", {
// opensaml libraries are provided
exclude group: 'org.opensaml'
exclude group: 'commons-collections'
}
compile 'org.apache.commons:commons-collections4:4.3'
compile "org.apache.commons:commons-collections4:${project.'commonsCollections4Version'}"

testCompile project(':backend')
testCompile 'org.springframework.boot:spring-boot-starter-test:2.6.7'
testCompile "org.opensaml:opensaml-saml-api:${project.'opensamlVersion'}"

testCompile "org.springframework.boot:spring-boot-starter-test:${project.'springbootVersion'}"
compile 'org.codehaus.groovy:groovy-all:3.0.10'
testImplementation platform("org.spockframework:spock-bom:2.1-groovy-3.0")
testImplementation "org.spockframework:spock-core"
testImplementation "org.spockframework:spock-spring"
testCompile 'org.opensaml:opensaml-saml-api:4.2.0'

annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:2.6.7'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${project.'springbootVersion'}"
}
15 changes: 14 additions & 1 deletion settings.gradle
@@ -1 +1,14 @@
include 'backend', 'ui', 'pac4j-module', 'beacon', 'beacon:core', 'beacon:spring'
pluginManagement {
resolutionStrategy {
eachPlugin {
if ( requested.id.id == 'org.springframework.boot' ) {
useModule( "org.springframework.boot:spring-boot-gradle-plugin:$springbootVersion" )
}
if ( requested.id.id == 'io.freefair.lombok' ) {
useModule( "io.freefair.gradle:lombok-plugin:$lombokVersion" )
}
}
}
}

include 'backend', 'ui', 'pac4j-module', 'beacon', 'beacon:core', 'beacon:spring'

0 comments on commit c51234a

Please sign in to comment.