Skip to content

Commit

Permalink
Merge branch 'master' into ck/#2-adaptColumnScheme
Browse files Browse the repository at this point in the history
  • Loading branch information
t-ober authored Mar 22, 2022
2 parents f7102b1 + 1cb40f2 commit 6fa1883
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 44 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- ckittl
- johanneshiry
18 changes: 10 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ if (env.BRANCH_NAME == "master") {

stage('deploy') {
log(i, "Deploying ${projects.get(0)} to maven central ...")
gradle("-p ${projects.get(0)} ${deployGradleTasks}")
gradle("${deployGradleTasks}", projects.get(0))

deployedArtifacts = "${projects.get(0)}, "
}
Expand Down Expand Up @@ -241,12 +241,12 @@ if (env.BRANCH_NAME == "master") {

// build and test the first project
log(i, "building and testing ${projects.get(0)}")
gradle("-p ${projects.get(0)} ${gradleTasks} ${mainProjectGradleTasks}")
gradle("${gradleTasks} ${mainProjectGradleTasks}", projects.get(0))
}

stage('SonarQube analysis') {
withSonarQubeEnv() { // Will pick the global server connection from jenkins for sonarqube
gradle("-p ${projects.get(0)} sonarqube -Dsonar.branch.name=master -Dsonar.projectKey=$sonarqubeProjectKey ")
gradle("sonarqube -Dsonar.branch.name=master -Dsonar.projectKey=$sonarqubeProjectKey ", projects.get(0))
}
}

Expand All @@ -273,7 +273,7 @@ if (env.BRANCH_NAME == "master") {


log(i, "Deploying ${projects.get(0)} to maven central ...")
gradle("-p ${projects.get(0)} --parallel ${deployGradleTasks}")
gradle("--parallel ${deployGradleTasks}", projects.get(0))

deployedArtifacts = "${projects.get(0)}, "

Expand Down Expand Up @@ -417,13 +417,13 @@ if (env.BRANCH_NAME == "master") {

// build and test the first project
log(i, "building and testing ${projects.get(0)}")
gradle("-p ${projects.get(0)} ${gradleTasks} ${mainProjectGradleTasks}")
gradle("${gradleTasks} ${mainProjectGradleTasks}", projects.get(0))
}


stage('SonarQube analysis') {
withSonarQubeEnv() { // Will pick the global server connection from jenkins for sonarqube
gradle("-p ${projects.get(0)} sonarqube -Dsonar.projectKey=$sonarqubeProjectKey -Dsonar.pullrequest.branch=${featureBranchName} -Dsonar.pullrequest.key=${resolveBranchNo(env.BRANCH_NAME)} -Dsonar.pullrequest.base=master -Dsonar.pullrequest.github.repository=${orgNames.get(0)}/${projects.get(0)} -Dsonar.pullrequest.provider=Github")
gradle("sonarqube -Dsonar.projectKey=$sonarqubeProjectKey -Dsonar.pullrequest.branch=${featureBranchName} -Dsonar.pullrequest.key=${resolveBranchNo(env.BRANCH_NAME)} -Dsonar.pullrequest.base=master -Dsonar.pullrequest.github.repository=${orgNames.get(0)}/${projects.get(0)} -Dsonar.pullrequest.provider=Github", projects.get(0))
}
}

Expand Down Expand Up @@ -566,9 +566,11 @@ def getMasterBranchProps() {

// gradle wrapper for easy execution
// requires the gradle version to be configured with the same name under tools in jenkins configuration
def gradle(command) {
def gradle(String command, String relativeProjectDir) {
env.JENKINS_NODE_COOKIE = 'dontKillMe' // this is necessary for the Gradle daemon to be kept alive
sh "${tool name: 'gradle6.3', type: 'hudson.plugins.gradle.GradleInstallation'}/bin/gradle ${command}"

// switch directory to be able to use gradle wrapper
sh(script: """set +x && cd $relativeProjectDir""" + ''' set +x; ./gradlew ''' + """$command""", returnStdout: false)
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
56 changes: 28 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
plugins {
id "com.jfrog.artifactory" version "4.9.7" //artifactory support
id "com.jfrog.artifactory" version "4.24.20" //artifactory support
id 'groovy' // groovy support
id 'java' // java support
id 'application' // creates a JVM executable
id 'maven-publish' // publish to a maven repo (local or mvn central, has to be defined)
id 'pmd' // code check, working on source code
id 'com.github.spotbugs' version '2.0.0' // code check, working on byte code
id 'com.diffplug.gradle.spotless' version '3.24.2'// code format
id 'com.simonharrer.modernizer' version '1.6.0-1' // detect deprecated APIs
id 'com.github.onslip.gradle-one-jar' version '1.0.5' // pack a self contained jar
id 'com.github.spotbugs' version '4.7.8' // code check, working on byte code
id 'com.diffplug.spotless' version '5.17.0'// code format
id 'com.simonharrer.modernizer' version '2.1.0-1' // detect deprecated APIs
id 'com.github.onslip.gradle-one-jar' version '1.0.6' // pack a self contained jar
id 'jacoco' // java code coverage plugin
id "org.sonarqube" version "2.7.1" // sonarqube
id "org.sonarqube" version "3.3" // sonarqube
}

ext {
//version (changing these should be considered thoroughly!)
hibernateVersion = '5.3.3.Final'
log4jVersion = '2.17.1'
picoliVersion = '4.6.1'
javaVersion = JavaVersion.VERSION_1_8

scriptsLocation = 'gradle' + File.separator + 'scripts' + File.separator //location of script plugins
Expand All @@ -41,8 +43,7 @@ apply from: scriptsLocation + 'jacoco.gradle' // jacoco java code coverage
apply from: scriptsLocation + 'sonarqube.gradle' // sonarqube config

repositories {
mavenLocal() //searches in local maven repository, typically ~/.m2/repository
jcenter() //searches in bintray's repository 'jCenter', which contains Maven Central
mavenCentral() //searches in bintray's repository 'jCenter', which contains Maven Central

maven { url 'https://jitpack.io' } // allows github repos as dependencies
}
Expand All @@ -53,39 +54,38 @@ tasks.withType(JavaCompile) {

dependencies {
//hibernate
compile 'org.hibernate:hibernate-core:' + hibernateVersion
compile 'org.hibernate:hibernate-ehcache:' + hibernateVersion
implementation 'org.hibernate:hibernate-core:' + hibernateVersion
implementation 'org.hibernate:hibernate-ehcache:' + hibernateVersion

//JAXB (needed for hibernate, but not longer contained in JDK9+)
implementation 'javax.xml.bind:jaxb-api:2.+'
implementation 'com.sun.xml.bind:jaxb-core:2.+'
implementation 'com.sun.xml.bind:jaxb-impl:2.+'
implementation 'javax.activation:activation:1.+'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'com.sun.xml.bind:jaxb-core:3.0.2'
implementation 'com.sun.xml.bind:jaxb-impl:3.0.2'
implementation 'javax.activation:activation:1.1.1'

//database
compile 'org.postgresql:postgresql:42.+'
compile 'javax.persistence:javax.persistence-api:2.2'
implementation 'org.postgresql:postgresql:42.2.24'
implementation 'javax.persistence:javax.persistence-api:2.2'

// logging
compile 'org.apache.logging.log4j:log4j-1.2-api:2.+' // log4j
compile 'org.apache.logging.log4j:log4j-core:2.+' // log4j
implementation "org.apache.logging.log4j:log4j-1.2-api:$log4jVersion" // log4j
implementation "org.apache.logging.log4j:log4j-core:$log4jVersion" // log4j

compile 'commons-io:commons-io:2.+'
compile 'org.apache.commons:commons-compress:1.+'
compile 'org.jetbrains:annotations:16.+'
annotationProcessor 'info.picocli:picocli-codegen:4.0.0'
compile 'info.picocli:picocli:4.0.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.+'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.apache.commons:commons-compress:1.21'
implementation 'org.jetbrains:annotations:23.0.0'
annotationProcessor "info.picocli:picocli-codegen:$picoliVersion"
implementation "info.picocli:picocli:$picoliVersion"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'

//tests
testCompile 'junit:junit:4.+'
// testCompile 'org.testcontainers:testcontainers:1.+'
testCompile 'org.testcontainers:postgresql:1.11.4'
testImplementation 'junit:junit:4.+'
testImplementation 'org.testcontainers:postgresql:1.16.0'

}

wrapper {
gradleVersion = '5.4.1'
gradleVersion = '7.2'
}

/* Maven publish - start */
Expand Down
9 changes: 4 additions & 5 deletions gradle/scripts/pmd.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// pmd is a code check tool, working on source code

pmd {
ignoreFailures true // dont let the build fail on rule violations

// pmd rule priority is a range from 1 to 5, with 1 being the highest priority
// the default rule priority is 5
rulePriority 2
consoleOutput = true
ignoreFailures = true
toolVersion = "6.37.0"
rulesMinimumPriority = 2
}
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Mar 06 16:26:07 CET 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 6fa1883

Please sign in to comment.