Merge pull request #90 from kemitix/upgrade-dependencies

Upgrade dependencies
This commit is contained in:
Paul Campbell 2018-07-07 14:08:58 +01:00 committed by GitHub
commit a68ba596e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 63 deletions

View file

@ -1,33 +1,25 @@
final String publicRepo = 'https://github.com/kemitix/'
final String mvn = "mvn --batch-mode --update-snapshots --errors" final String mvn = "mvn --batch-mode --update-snapshots --errors"
final dependenciesSupportJDK=9 final dependenciesSupportJDK=9
pipeline { pipeline {
agent any agent any
stages { stages {
stage('master != SNAPSHOT') {
// checks that the pom version is not a snapshot when the current or target branch is master
when {
expression {
(env.GIT_BRANCH == 'master' || env.CHANGE_TARGET == 'master') &&
(readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT")
}
}
steps {
error("Build failed because SNAPSHOT version")
}
}
stage('Build & Test') { stage('Build & Test') {
steps { steps {
withMaven(maven: 'maven', jdk: 'JDK LTS') { withMaven(maven: 'maven', jdk: 'JDK 1.8') {
sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test" sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test"
//junit '**/target/surefire-reports/*.xml' // Code Coverage to Codacy
sh "${mvn} -pl builder jacoco:report com.gavinmogan:codacy-maven-plugin:coverage " + sh "${mvn} -pl builder jacoco:report com.gavinmogan:codacy-maven-plugin:coverage " +
"-DcoverageReportFile=target/site/jacoco/jacoco.xml " + "-DcoverageReportFile=target/site/jacoco/jacoco.xml " +
"-DprojectToken=`$JENKINS_HOME/codacy/token` " + "-DprojectToken=`$JENKINS_HOME/codacy/token` " +
"-DapiToken=`$JENKINS_HOME/codacy/apitoken` " + "-DapiToken=`$JENKINS_HOME/codacy/apitoken` " +
"-Dcommit=`git rev-parse HEAD`" "-Dcommit=`git rev-parse HEAD`"
// Code Coverage to Jenkins
jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class'
// PMD to Jenkins
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
// Checkstyle to Jenkins
step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher', step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher',
pattern: '**/target/checkstyle-result.xml', pattern: '**/target/checkstyle-result.xml',
healthy:'20', healthy:'20',
@ -37,32 +29,32 @@ pipeline {
} }
stage('Verify & Install') { stage('Verify & Install') {
steps { steps {
withMaven(maven: 'maven', jdk: 'JDK LTS') { withMaven(maven: 'maven', jdk: 'JDK 1.8') {
sh "${mvn} -DskipTests install" sh "${mvn} -DskipTests install"
} }
} }
} }
stage('SonarQube (github only)') { stage('SonarQube (published)') {
when { expression { env.GIT_URL.startsWith('https://github.com') } } when { expression { isPublished(publicRepo) } }
steps { steps {
withSonarQubeEnv('sonarqube') { withSonarQubeEnv('sonarqube') {
withMaven(maven: 'maven', jdk: 'JDK LTS') { withMaven(maven: 'maven', jdk: 'JDK 1.8') {
sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar" sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar"
} }
} }
} }
} }
stage('Archiving') { stage('Deploy (published release branch)') {
when { expression { findFiles(glob: '**/target/*.jar').length > 0 } } when {
steps { expression {
archiveArtifacts '**/target/*.jar' (isReleaseBranch() &&
isPublished(publicRepo) &&
notSnapshot())
} }
} }
stage('Deploy (master on github)') {
when { expression { (env.GIT_BRANCH == 'master' && env.GIT_URL.startsWith('https://github.com')) } }
steps { steps {
withMaven(maven: 'maven', jdk: 'JDK LTS') { withMaven(maven: 'maven', jdk: 'JDK 1.8') {
sh "${mvn} deploy -pl ruleset,tile --activate-profiles release -DskipTests=true" sh "${mvn} -pl ruleset,tile --activate-profiles release deploy"
} }
} }
} }
@ -84,3 +76,23 @@ pipeline {
} }
} }
} }
private boolean isReleaseBranch() {
return branchStartsWith('release/')
}
private boolean branchStartsWith(final String branchName) {
startsWith(env.GIT_BRANCH, branchName)
}
private boolean isPublished(final String repo) {
startsWith(env.GIT_URL, repo)
}
private static boolean startsWith(final String value, final String match) {
value != null && value.startsWith(match)
}
private boolean notSnapshot() {
return !(readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT")
}

View file

@ -5,12 +5,8 @@ Provides an extensive Checkstyle ruleset for use with Checkstyle, together with
[![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/https/oss.sonatype.org/net.kemitix/kemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://oss.sonatype.org/content/repositories/releases/net/kemitix/kemitix-checkstyle-ruleset/) [![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/https/oss.sonatype.org/net.kemitix/kemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://oss.sonatype.org/content/repositories/releases/net/kemitix/kemitix-checkstyle-ruleset/)
[![Maven Central](https://img.shields.io/maven-central/v/net.kemitix/kemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://search.maven.org/#search|ga|1|g%3A"net.kemitix"%20AND%20a%3A"kemitix-checkstyle-ruleset") [![Maven Central](https://img.shields.io/maven-central/v/net.kemitix/kemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://search.maven.org/#search|ga|1|g%3A"net.kemitix"%20AND%20a%3A"kemitix-checkstyle-ruleset")
[![SonarQube Coverage](https://img.shields.io/sonar/https/sonarcloud.io/net.kemitix%3Akemitix-checkstyle-ruleset/coverage.svg?style=for-the-badge)](https://sonarcloud.io/dashboard?id=net.kemitix%3Akemitix-checkstyle-ruleset) [![SonarQube Coverage](https://img.shields.io/sonar/https/sonarcloud.io/net.kemitix.checkstyle%3Akemitix-checkstyle-ruleset/coverage.svg?style=for-the-badge)](https://sonarcloud.io/dashboard?id=net.kemitix%3Akemitix-checkstyle-ruleset)
[![SonarQube Tech Debt](https://img.shields.io/sonar/https/sonarcloud.io/net.kemitix%3Akemitix-checkstyle-ruleset/tech_debt.svg?style=for-the-badge)](https://sonarcloud.io/dashboard?id=net.kemitix%3Akemitix-checkstyle-ruleset) [![SonarQube Tech Debt](https://img.shields.io/sonar/https/sonarcloud.io/net.kemitix.checkstyle%3Akemitix-checkstyle-ruleset/tech_debt.svg?style=for-the-badge)](https://sonarcloud.io/dashboard?id=net.kemitix%3Akemitix-checkstyle-ruleset)
[![Jenkins](https://img.shields.io/jenkins/s/https/jenkins.kemitix.net/job/GitLab/job/kemitix%252Fkemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://jenkins.kemitix.net/job/GitLab/job/kemitix%252Fkemitix-checkstyle-ruleset/)
[![Jenkins tests](https://img.shields.io/jenkins/t/https/jenkins.kemitix.net/job/GitLab/job/kemitix%252Fkemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://jenkins.kemitix.net/job/GitLab/job/kemitix%252Fkemitix-checkstyle-ruleset/)
[![Jenkins coverage](https://img.shields.io/jenkins/c/https/jenkins.kemitix.net/job/GitLab/job/kemitix%252Fkemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://jenkins.kemitix.net/job/GitLab/job/kemitix%252Fkemitix-checkstyle-ruleset/)
[![Codacy grade](https://img.shields.io/codacy/grade/d57096b0639d496aba9a7e43e7cf5b4c.svg?style=for-the-badge)](https://app.codacy.com/project/kemitix/kemitix-checkstyle-ruleset/dashboard) [![Codacy grade](https://img.shields.io/codacy/grade/d57096b0639d496aba9a7e43e7cf5b4c.svg?style=for-the-badge)](https://app.codacy.com/project/kemitix/kemitix-checkstyle-ruleset/dashboard)
@ -43,7 +39,7 @@ The simplest way to use the ruleset is with the maven-tile:
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<tiles> <tiles>
<tile>net.kemitix.checkstyle:tile:4.1.1</tile> <tile>net.kemitix.checkstyle:tile:RELEASE</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>

View file

@ -7,14 +7,14 @@
<parent> <parent>
<groupId>net.kemitix</groupId> <groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId> <artifactId>kemitix-parent</artifactId>
<version>5.1.0</version> <version>5.1.1</version>
<relativePath/> <relativePath/>
</parent> </parent>
<groupId>net.kemitix.checkstyle</groupId> <groupId>net.kemitix.checkstyle</groupId>
<artifactId>builder</artifactId> <artifactId>builder</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>4.1.1</version> <version>DEV-SNAPSHOT</version>
<properties> <properties>
<maven.install.skip>true</maven.install.skip> <maven.install.skip>true</maven.install.skip>
@ -23,30 +23,30 @@
<kemitix-tiles.version>0.8.1</kemitix-tiles.version> <kemitix-tiles.version>0.8.1</kemitix-tiles.version>
<checkstyle.version>8.10</checkstyle.version> <checkstyle.version>8.10</checkstyle.version>
<sevntu.version>1.29.0</sevntu.version> <sevntu.version>1.30.0</sevntu.version>
<lombok.version>1.16.20</lombok.version> <lombok.version>1.18.0</lombok.version>
<spring-platform.version>Brussels-SR6</spring-platform.version> <spring-platform.version>Brussels-SR6</spring-platform.version>
<spring-boot.version>1.5.9.RELEASE</spring-boot.version> <spring-boot.version>1.5.14.RELEASE</spring-boot.version>
<mapstream.version>2.3.5</mapstream.version> <mapstream.version>2.3.5</mapstream.version>
<map-builder.version>1.0.0</map-builder.version> <map-builder.version>1.0.0</map-builder.version>
<mockito.version>2.13.0</mockito.version> <mockito.version>2.19.0</mockito.version>
<assertj.version>3.9.0</assertj.version> <assertj.version>3.10.0</assertj.version>
<conditional.version>0.3.0</conditional.version> <conditional.version>0.4.0</conditional.version>
<fast-classpath-scanner.version>2.18.1</fast-classpath-scanner.version> <fast-classpath-scanner.version>3.1.6</fast-classpath-scanner.version>
<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version> <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
<kemitix.checkstyle.ruleset.version>${project.version}</kemitix.checkstyle.ruleset.version> <kemitix.checkstyle.ruleset.version>${project.version}</kemitix.checkstyle.ruleset.version>
<kemitix.checkstyle.ruleset.level>5-complexity</kemitix.checkstyle.ruleset.level> <kemitix.checkstyle.ruleset.level>5-complexity</kemitix.checkstyle.ruleset.level>
<kemitix.checkstyle.ruleset.location>net/kemitix/checkstyle-${kemitix.checkstyle.ruleset.level}.xml</kemitix.checkstyle.ruleset.location> <kemitix.checkstyle.ruleset.location>net/kemitix/checkstyle-${kemitix.checkstyle.ruleset.level}.xml</kemitix.checkstyle.ruleset.location>
<javax.annotation-api.version>1.2</javax.annotation-api.version> <javax.annotation-api.version>1.3.2</javax.annotation-api.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>io.spring.platform</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>platform-bom</artifactId> <artifactId>spring-boot-dependencies</artifactId>
<version>${spring-platform.version}</version> <version>${spring-boot.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View file

@ -2,6 +2,14 @@
Provides an extensive Checkstyle ruleset for use with Checkstyle, together with a fully configured maven-tile. Provides an extensive Checkstyle ruleset for use with Checkstyle, together with a fully configured maven-tile.
[![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/https/oss.sonatype.org/net.kemitix/kemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://oss.sonatype.org/content/repositories/releases/net/kemitix/kemitix-checkstyle-ruleset/)
[![Maven Central](https://img.shields.io/maven-central/v/net.kemitix/kemitix-checkstyle-ruleset.svg?style=for-the-badge)](https://search.maven.org/#search|ga|1|g%%3A"net.kemitix"%%20AND%%20a%%3A"kemitix-checkstyle-ruleset")
[![SonarQube Coverage](https://img.shields.io/sonar/https/sonarcloud.io/net.kemitix.checkstyle%%3Akemitix-checkstyle-ruleset/coverage.svg?style=for-the-badge)](https://sonarcloud.io/dashboard?id=net.kemitix%%3Akemitix-checkstyle-ruleset)
[![SonarQube Tech Debt](https://img.shields.io/sonar/https/sonarcloud.io/net.kemitix.checkstyle%%3Akemitix-checkstyle-ruleset/tech_debt.svg?style=for-the-badge)](https://sonarcloud.io/dashboard?id=net.kemitix%%3Akemitix-checkstyle-ruleset)
[![Codacy grade](https://img.shields.io/codacy/grade/d57096b0639d496aba9a7e43e7cf5b4c.svg?style=for-the-badge)](https://app.codacy.com/project/kemitix/kemitix-checkstyle-ruleset/dashboard)
The ruleset includes checks from both the core Checkstyle library and from the Sevntu-Checkstyle library. The ruleset includes checks from both the core Checkstyle library and from the Sevntu-Checkstyle library.
* [Usage](#usage) * [Usage](#usage)
@ -31,7 +39,7 @@ The simplest way to use the ruleset is with the maven-tile:
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<tiles> <tiles>
<tile>net.kemitix.checkstyle:tile:4.1.1</tile> <tile>net.kemitix.checkstyle:tile:RELEASE</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>

View file

@ -7,13 +7,13 @@
<parent> <parent>
<groupId>net.kemitix</groupId> <groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId> <artifactId>kemitix-parent</artifactId>
<version>5.1.0</version> <version>5.1.1</version>
<relativePath/> <relativePath/>
</parent> </parent>
<groupId>net.kemitix.checkstyle</groupId> <groupId>net.kemitix.checkstyle</groupId>
<artifactId>ruleset</artifactId> <artifactId>ruleset</artifactId>
<version>4.1.1</version> <version>DEV-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Kemitix Checkstyle Ruleset</name> <name>Kemitix Checkstyle Ruleset</name>
@ -22,8 +22,7 @@
<properties> <properties>
<tiles-maven-plugin.version>2.11</tiles-maven-plugin.version> <tiles-maven-plugin.version>2.11</tiles-maven-plugin.version>
<kemitix-tiles.version>0.8.1</kemitix-tiles.version> <kemitix-tiles.version>0.9.0</kemitix-tiles.version>
<maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
</properties> </properties>
<licenses> <licenses>
@ -62,14 +61,6 @@
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>

View file

@ -5,14 +5,14 @@
<parent> <parent>
<groupId>net.kemitix</groupId> <groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId> <artifactId>kemitix-parent</artifactId>
<version>5.1.0</version> <version>5.1.1</version>
<relativePath/> <relativePath/>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.kemitix.checkstyle</groupId> <groupId>net.kemitix.checkstyle</groupId>
<artifactId>tile</artifactId> <artifactId>tile</artifactId>
<version>4.1.1</version> <version>DEV-SNAPSHOT</version>
<packaging>tile</packaging> <packaging>tile</packaging>

View file

@ -3,7 +3,7 @@
<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version> <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
<checkstyle.version>8.10</checkstyle.version> <checkstyle.version>8.10</checkstyle.version>
<sevntu.version>1.29.0</sevntu.version> <sevntu.version>1.29.0</sevntu.version>
<kemitix.checkstyle.ruleset.version>4.1.1</kemitix.checkstyle.ruleset.version> <kemitix.checkstyle.ruleset.version>DEV-SNAPSHOT</kemitix.checkstyle.ruleset.version>
<kemitix.checkstyle.ruleset.level>5-complexity</kemitix.checkstyle.ruleset.level> <kemitix.checkstyle.ruleset.level>5-complexity</kemitix.checkstyle.ruleset.level>
<kemitix.checkstyle.ruleset.location>net/kemitix/checkstyle-${kemitix.checkstyle.ruleset.level}.xml</kemitix.checkstyle.ruleset.location> <kemitix.checkstyle.ruleset.location>net/kemitix/checkstyle-${kemitix.checkstyle.ruleset.level}.xml</kemitix.checkstyle.ruleset.location>
</properties> </properties>