Skip to content

Commit

Permalink
Merge branch 'release/5.1.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Apr 29, 2022
2 parents 6352156 + 3e7af2f commit ca60cd8
Show file tree
Hide file tree
Showing 15 changed files with 320 additions and 171 deletions.
6 changes: 3 additions & 3 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=17.0.1-tem
java=17.0.3-tem
gradle=7.3.3
grails=5.1.2
groovy=3.0.9
grails=5.1.7
groovy=3.0.10
91 changes: 91 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
pipeline {
agent any

environment {
JENKINS = 'true'
}

tools {
jdk 'jdk-17'
}

options {
timestamps()
timeout(time: 30, unit: 'MINUTES')
skipStagesAfterUnstable()
buildDiscarder(logRotator(numToKeepStr: '30'))
}

stages {

stage('Clean') {
// Only clean when the last build failed
when {
expression {
currentBuild.previousBuild?.currentResult == 'FAILURE'
}
}
steps {
sh "./gradlew clean"
}
}

stage('Info') {
steps {
sh './gradlew -v' // Output gradle version for verification checks
sh './grailsw -v' // Output grails version for verification checks
}
}

stage('Test cleanup & Compile') {
steps {
sh './gradlew compile'
}
}

stage('License Header Check') {
steps {
warnError('Missing License Headers') {
sh './gradlew --build-cache license'
}
}
}

stage('Sonarqube') {
when {
branch 'main'
}
steps {
withSonarQubeEnv('JenkinsQube') {
sh "./gradlew sonarqube"
}
}
}

// stage('Deploy to Artifactory') {
// when {
// allOf {
// anyOf {
// branch 'main'
// branch 'develop'
// }
// expression {
// currentBuild.currentResult == 'SUCCESS'
// }
// }
//
// }
// steps {
// script {
// sh "./gradlew --build-cache publish"
// }
// }
// }
}

post {
always {
zulipNotification(topic: 'mdm-application-build')
}
}
}
41 changes: 27 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import io.spring.gradle.dependencymanagement.internal.DependencyManagementConfigurationContainer
import io.spring.gradle.dependencymanagement.internal.maven.MavenPomResolver
import io.spring.gradle.dependencymanagement.internal.pom.Coordinates
import io.spring.gradle.dependencymanagement.internal.pom.Pom
import io.spring.gradle.dependencymanagement.internal.pom.PomReference
import io.spring.gradle.dependencymanagement.internal.properties.MapPropertySource
import io.spring.gradle.dependencymanagement.internal.properties.ProjectPropertySource
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

import java.util.concurrent.TimeUnit
Expand All @@ -14,15 +21,6 @@ buildscript {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "org.grails.plugins:hibernate5:$grailsHibernate5Version"
classpath "org.grails.plugins:views-gradle:$grailsViewsVersion"

// The version of spring-core included is 3.1.3.RELEASE which is incompatible with the grails-gradle-plugin used by all the
// the Grails modules and causes issues when trying to run-app therefore we exclude it
classpath("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseGradlePluginVersion") {
exclude group: 'org.springframework', module: 'spring-core'
}
// However without spring-core the license plugin won't work so we need to include it at the top level
// this version will need to be kept inline with Grails' spring-core
classpath "org.springframework:spring-core:$licenseGradlePluginSpringCoreOverrideVersion"
}
configurations.all {
// check for updates every build
Expand All @@ -33,16 +31,17 @@ buildscript {

plugins {
id 'project-report'
id "com.github.hierynomus.license" version "${licenseGradlePluginVersion}"
}

apply plugin: "idea"
apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.plugins.views-json"
apply plugin: "org.grails.plugins.views-markup"
apply plugin: "com.github.hierynomus.license"
apply plugin: 'ox.softeng.ox-brc-base'


repositories {
mavenLocal()
maven {url "https://jenkins.cs.ox.ac.uk/artifactory/libs-release"}
Expand Down Expand Up @@ -96,7 +95,7 @@ dependencies {
testImplementation "io.micronaut:micronaut-http-client"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.grails:views-json-testing-support"
testImplementation "org.hibernate.validator:hibernate-validator:6.2.0.Final"
testImplementation "org.hibernate.validator:hibernate-validator"
testImplementation "io.micronaut:micronaut-http-client"
}

Expand All @@ -106,7 +105,7 @@ bootRun {
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
'-Xmx8g')
sourceResources sourceSets.main

System.properties.each {prop ->
Expand All @@ -120,7 +119,7 @@ bootRun {

grails {
plugins {
runtimeOnly "uk.ac.ox.softeng.maurodatamapper:mdm-core:$version"
implementation "uk.ac.ox.softeng.maurodatamapper:mdm-core:$version"
runtimeOnly "uk.ac.ox.softeng.maurodatamapper:mdm-security:$version"
runtimeOnly "uk.ac.ox.softeng.maurodatamapper:mdm-plugin-authentication-apikey:$version"
runtimeOnly "uk.ac.ox.softeng.maurodatamapper:mdm-plugin-authentication-basic:$version"
Expand Down Expand Up @@ -161,7 +160,9 @@ configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, TimeUnit.SECONDS
}

project.afterEvaluate {
controlVersionPropertiesFromMdmBom()

afterEvaluate {

project.tasks.withType(JavaCompile) {JavaCompile c ->
c.options.fork = true
Expand Down Expand Up @@ -191,4 +192,16 @@ project.afterEvaluate {
}
group 'archives'
}
}

// Pulls the properties from the mdm-bom and applies them to the project
// Theres collisions between the gradle platform and spring dependency plugin which result in the versions we want not being used
void controlVersionPropertiesFromMdmBom() {
MavenPomResolver pomResolver = new MavenPomResolver(project, new DependencyManagementConfigurationContainer(project))
Coordinates bomCoords = new Coordinates('uk.ac.ox.softeng.maurodatamapper', 'mdm-bom', version)
PomReference pomReference = new PomReference(bomCoords, new MapPropertySource([:]))
List<Pom> resolvedPoms = pomResolver.resolvePoms([pomReference], new ProjectPropertySource(project))
resolvedPoms.first().properties.sort().each {k, v ->
project.ext[k] = v
}
}
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dependencies {
implementation platform("uk.ac.ox.softeng.maurodatamapper:mdm-bom:$version")
runtimeOnly "io.methvin:directory-watcher", {
exclude group: 'com.google.guava', module: 'guava'
}
Expand Down
53 changes: 18 additions & 35 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,49 +1,32 @@
# Core Info
version=5.0.0
version=5.1.0
group=uk.ac.ox.softeng.maurodatamapper
# Gradle
gradleVersion=7.3.3
org.gradle.jvmargs=-Dfile.encoding=UTF-8
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx2g
org.gradle.parallel=true
org.gradle.caching=true
# Code
sourceCompatibility=17
targetCompatibility=17
# Deployment & Build
artifactory_contextUrl=https://jenkins.cs.ox.ac.uk/artifactory
oxbrcinformaticsGradlePluginsVersion=7.2
oxbrcinformaticsGradlePluginsVersion=7.8
licenseGradlePluginVersion=0.16.1
licenseGradlePluginSpringCoreOverrideVersion=5.3.14
## Grails
grailsVersion=5.1.2
grailsGradlePluginVersion=5.1.1
groovyVersion=3.0.9
grailsHibernate5Version=7.2.1
# Grails
grailsVersion=5.1.7
grailsGradlePluginVersion=5.1.4
groovyVersion=3.0.10
grailsHibernate5Version=7.2.2
grailsViewsVersion=2.2.0
## Hibernate & Database
hibernateSearchVersion=3.0.0-SNAPSHOT
hibernateSearchOrmVersion=6.0.8.OXBRC
luceneVersion=8.7.0
## Core
assetPipelineVersion=3.3.6
springBootVersion=2.6.1
spotbugsAnnotationVersion=4.4.2
commonsTextVersion=1.9
commonsCsvVersion=1.8
javaMailVersion=6.6.1
guavaVersion=31.0.1-jre
commonsBeanutilsVersion=1.9.4
assetPipelineVersion=3.4.6
jaxbApiVersion=2.3.1
## Security
commonsRngVersion=1.4
## BOM Overrides
caffeine.version=2.9.3
groovy.version=3.0.9
#tomcat.version=10.0.8 # spring boot 2.6.1 will not work with tomcat 10
hibernate.version=5.6.3.Final
#TODO update to logback.xml so we can migrate to 1.2.9
logback.version=1.2.7
snakeyaml.version=1.30
testingSupport.version=2.4.0
micronaut.version=3.2.7
#mssql-jdbc.version=8.4.0.jre11
springBootVersion=2.6.7

## v2.2.1 includes a logback.xml file which needs to be removed before we can update
#views-json.version=2.2.0
#views-markup.version=2.2.0
#views-json-testing-support.version=2.2.0
#views-json-templates.version=2.2.0
## This really needs updating ASAP but the v5/v6 builds have issues
#cache.version=4.0.3
4 changes: 4 additions & 0 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ dataSource:
dbCreate: none
url: 'jdbc:postgresql://${database.host}:${database.port}/${database.name}'
---
grails:
plugins:
hibernatesearch:
rebuildIndexOnStart: false
Loading

0 comments on commit ca60cd8

Please sign in to comment.