Skip to content

Commit

Permalink
maven clean up, fix checkstyle reporting (#65)
Browse files Browse the repository at this point in the history
* messing with Maven Dependency mess. upgrading some dependencies, removing unused reporting (maven site), enabeling personal checkstyle sheet
* clean up whitespace
  • Loading branch information
SlowMo24 authored and tyrasd committed Jan 30, 2019
1 parent 63b766b commit d05e345
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 74 deletions.
46 changes: 20 additions & 26 deletions Jenkinsfile
Expand Up @@ -52,7 +52,7 @@ pipeline {
}
}
}

stage ('Trigger Benchmark') {
when {
expression {
Expand All @@ -68,7 +68,7 @@ pipeline {
}
}
}

stage ('Publish Javadoc'){
when {
expression {
Expand All @@ -83,16 +83,16 @@ pipeline {

javadc_dir="/srv/javadoc/java/" + reponame + "/" + projver + "/"
echo javadc_dir


rtMaven.run pom: 'pom.xml', goals: 'clean javadoc:javadoc -Dadditionalparam=-Xdoclint:none -Dmaven.repo.local=.m2'
sh "echo $javadc_dir"
//make sure jenkins uses bash not dash!
sh "mkdir -p $javadc_dir && rm -Rf $javadc_dir* && find . -path '*/target/site/apidocs' -exec cp -R --parents {} $javadc_dir \\; && find $javadc_dir -path '*/target/site/apidocs' | while read line; do echo \$line; neu=\${line/target\\/site\\/apidocs/} ; mv \$line/* \$neu ; done && find $javadc_dir -type d -empty -delete"
}

script{

javadc_dir=javadc_dir + "aggregated/"
rtMaven.run pom: 'pom.xml', goals: 'clean javadoc:aggregate -Dadditionalparam=-Xdoclint:none -Dmaven.repo.local=.m2'
sh "mkdir -p $javadc_dir && rm -Rf $javadc_dir* && find . -path './target/site/apidocs' -exec cp -R --parents {} $javadc_dir \\; && find $javadc_dir -path '*/target/site/apidocs' | while read line; do echo \$line; neu=\${line/target\\/site\\/apidocs/} ; mv \$line/* \$neu ; done && find $javadc_dir -type d -empty -delete"
Expand All @@ -102,23 +102,17 @@ pipeline {
failure {
rocketSend channel: 'jenkinsohsome', message: "Deployment of javadoc oshdb-build nr. ${env.BUILD_NUMBER} *failed* on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>). Latest commit from ${author}." , rawMessage: true
}
}
}
}

stage ('Reports and Statistics'){
steps {
script{
projver=sh(returnStdout: true, script: 'mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev "(^\\[|Download\\w+)"').trim()

//maven site
report_dir="/srv/reports/" + reponame + "/" + projver+ "_" + env.BRANCH_NAME +"/" + env.BUILD_NUMBER + "_" +gittiid+ "/site/"

rtMaven.run pom: 'pom.xml', goals: 'clean site -Dmaven.repo.local=.m2'
sh "mkdir -p $report_dir && rm -Rf $report_dir* && find . -path '*/target/site' -exec cp -R --parents {} $report_dir \\; && find $report_dir -path '*/target/site' | while read line; do echo \$line; neu=\${line/target\\/site/} ; mv \$line/* \$neu ; done && find $report_dir -type d -empty -delete"


//jacoco
report_dir="/srv/reports/" + reponame + "/" + projver + "_" + env.BRANCH_NAME + "/" + env.BUILD_NUMBER + "_" +gittiid+"/jacoco/"

rtMaven.run pom: 'pom.xml', goals: 'clean verify -Pjacoco -Dmaven.repo.local=.m2'
sh "mkdir -p $report_dir && rm -Rf $report_dir* && find . -path '*/target/site/jacoco' -exec cp -R --parents {} $report_dir \\; && find $report_dir -path '*/target/site/jacoco' | while read line; do echo \$line; neu=\${line/target\\/site\\/jacoco/} ; mv \$line/* \$neu ; done && find $report_dir -type d -empty -delete"

Expand All @@ -129,7 +123,7 @@ pipeline {
sh "infer run -r -- mvn compile"
sh "mkdir -p $report_dir && rm -Rf $report_dir* && cp -R ./infer-out/* $report_dir"
}

//warnings plugin
rtMaven.run pom: 'pom.xml', goals: '--batch-mode -V -e checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs com.github.spotbugs:spotbugs-maven-plugin:3.1.7:spotbugs -Dmaven.repo.local=.m2'

Expand All @@ -141,18 +135,18 @@ pipeline {
recordIssues enabledForFailure: true, tool: pmd(pattern: '**/target/pmd.xml')

}
}
}
post {
failure {
rocketSend channel: 'jenkinsohsome', message: "Reporting of oshdb-build nr. ${env.BUILD_NUMBER} *failed* on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>). Latest commit from ${author}." , rawMessage: true
}
}
}
}





stage ('Encourage') {
when {
when {
expression {
if(currentBuild.number > 1){
datepre=new Date(currentBuild.previousBuild.rawBuild.getStartTimeInMillis()).clearTime()
Expand All @@ -171,9 +165,9 @@ pipeline {
failure {
rocketSend channel: 'jenkinsohsome', emoji: ':wink:' , message: "Reporting of oshdb-build nr. ${env.BUILD_NUMBER} *failed* on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>). Latest commit from ${author}." , rawMessage: true
}
}
}
}

stage ('Report Status Change'){
when {
expression {
Expand All @@ -187,8 +181,8 @@ pipeline {
failure {
rocketSend channel: 'jenkinsohsome', message: "Reporting of oshdb-build nr. ${env.BUILD_NUMBER} *failed* on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>). Latest commit from ${author}." , rawMessage: true
}
}
}

}

}
Expand Down
106 changes: 58 additions & 48 deletions pom.xml
@@ -1,25 +1,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.heigit.bigspatialdata</groupId>
<artifactId>bigspatialdata-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>bigspatialdata-core-parent</artifactId>
<version>0.5.0-SNAPSHOT</version>
<name>HeiGIT Big Spatial Data Core Parent POM</name>
<description>The set of base functionality provided for all configurations of BigSpatialData</description>
<description>The set of base functionality provided for all configurations of BigSpatialData</description>
<packaging>pom</packaging>

<modules>
<module>oshdb</module>
<module>oshdb-api</module>
<module>oshdb-tool</module>
<module>oshdb-util</module>
</modules>

<properties>
<apachecommons.version>3.1</apachecommons.version>
<commonsio.version>2.5</commonsio.version>
Expand All @@ -41,8 +41,16 @@
<roaringbitmap.version>0.6.59</roaringbitmap.version>
<rxjava2.version>2.1.9</rxjava2.version>
<wololo.version>0.10.0</wololo.version>
<mavencheckstyle.version>3.0.0</mavencheckstyle.version>
<checkstyle.version>8.17</checkstyle.version>
<jacoco.version>0.8.3</jacoco.version>
<gitcommitplugin.version>2.2.6</gitcommitplugin.version>
<mavenprojectinfo.version>3.0.0</mavenprojectinfo.version>
<mavenpmd.version>2.9</mavenpmd.version>
<pmd.version>6.11.0</pmd.version>
<mavenpmd.version>3.11.0</mavenpmd.version>
</properties>

<repositories>
<repository>
<!--This will resolve artefacts of Osgeo, Boundless and potentially others through our own reopository (https://www.jfrog.com/confluence/display/RTF/Maven+Repository#MavenRepository-ResolvingArtifactsthroughArtifactory).-->
Expand All @@ -58,19 +66,57 @@
<snapshots />
</repository>
</repositories>

<scm>
<!-- https://maven.apache.org/pom.html#SCM -->
<connection>scm:git:git@github.com/GIScience/oshdb.git</connection>
<developerConnection>scm:git:git@github.com/GIScience/oshdb.git</developerConnection>
<url>https://github.com/GIScience/oshdb.git</url>
</scm>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/GIScience/oshdb/issues</url>
</issueManagement>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${mavencheckstyle.version}</version>
<configuration>
<configLocation>config/ide/checkstyle-google-oshdb.xml</configLocation>
</configuration>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${mavenpmd.version}</version>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>${pmd.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>${pmd.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jacoco</id>
Expand All @@ -79,7 +125,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>default-prepare-agent</id>
Expand All @@ -98,15 +144,15 @@
</plugins>
</build>
</profile>

<profile>
<id>git</id>
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.4</version>
<version>${gitcommitplugin.version}</version>
<executions>
<execution>
<id>get-the-git-infos</id>
Expand All @@ -133,40 +179,4 @@
</build>
</profile>
</profiles>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
<reportSets>
<reportSet>
<reports>
<!--<report>dependencies</report>
<report>project-team</report>
<report>mailing-list</report>
<report>cim</report>
<report>issue-tracking</report>
<report>license</report>
<report>scm</report> -->
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<configLocation>google_checks.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.9.0</version>
</plugin>
</plugins>
</reporting>
</project>

0 comments on commit d05e345

Please sign in to comment.