Skip to content

Commit

Permalink
Jetty 9.4.x optimize parser warning from logs and add spotbug (#5735)
Browse files Browse the repository at this point in the history
* enable spotbugs in CI

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

record issues

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

use warning new generation

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

activate errorprone

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

fix Jenkinsfile

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

do not run spotbugs for jetty-runner as we do not want to fix all dependencies bugs :)

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

junit should allow empty results

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

maven console can be use only once...

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

one liner

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

recordissues only once

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

force id

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

aggregate results

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

configure a name for aggregated reports

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

mo more -T3 no need anymore of remote session test profile

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

I want to see what failing tests look like with new report.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

skip spotbugs for jetty-jmh

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

get rid of findbugs as we now have spotbugs

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

Revert "I want to see what failing tests look like with new report."

This reverts commit df0d13e.

activate errorProne parser

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

make pmd quiet for CI

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

remove -fae flag and do not display transfer progress

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

try junitParser() to see what it does

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

junit parser is a bad idea...

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

increase timeout

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

no -T2 for javadoc

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

fix skip spotbugs and pmd verbose

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* remove -T options

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
  • Loading branch information
olamy committed Dec 11, 2020
1 parent ea621ce commit 639cad6
Show file tree
Hide file tree
Showing 40 changed files with 106 additions and 338 deletions.
29 changes: 13 additions & 16 deletions Jenkinsfile
Expand Up @@ -12,8 +12,7 @@ pipeline {
steps {
container('jetty-build') {
timeout( time: 240, unit: 'MINUTES' ) {
mavenBuild( "jdk8", "clean install", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
mavenBuild( "jdk8", "clean install", "maven3")
// Collect up the jacoco execution results (only on main build)
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
exclusionPattern: '' +
Expand All @@ -32,6 +31,7 @@ pipeline {
execPattern: '**/target/jacoco.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java'
recordIssues id: "jdk8", name: "Static Analysis jdk8", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
}
}
}
Expand All @@ -42,8 +42,8 @@ pipeline {
steps {
container( 'jetty-build' ) {
timeout( time: 240, unit: 'MINUTES' ) {
mavenBuild( "jdk11", "clean install -Djacoco.skip=true", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
mavenBuild( "jdk11", "clean install -Djacoco.skip=true -Perrorprone", "maven3")
recordIssues id: "jdk11", name: "Static Analysis jdk11", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne()]
}
}
}
Expand All @@ -54,8 +54,8 @@ pipeline {
steps {
container( 'jetty-build' ) {
timeout( time: 240, unit: 'MINUTES' ) {
mavenBuild( "jdk15", "clean install -Djacoco.skip=true", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
mavenBuild( "jdk15", "clean install -Djacoco.skip=true", "maven3")
recordIssues id: "jdk15", name: "Static Analysis jdk15", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
}
}
}
Expand All @@ -65,10 +65,11 @@ pipeline {
agent { node { label 'linux' } }
steps {
container( 'jetty-build' ) {
timeout( time: 60, unit: 'MINUTES' ) {
timeout( time: 120, unit: 'MINUTES' ) {
mavenBuild( "jdk11",
"install javadoc:javadoc javadoc:aggregate-jar -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true",
"maven3", [[parserName: 'Maven'], [parserName: 'JavaDoc'], [parserName: 'Java']])
"maven3")
recordIssues id: "javadoc", enabledForFailure: true, tools: [javaDoc()]
}
}
}
Expand All @@ -78,9 +79,8 @@ pipeline {
agent { node { label 'linux' } }
steps {
container( 'jetty-build' ) {
timeout( time: 60, unit: 'MINUTES' ) {
mavenBuild( "jdk8", "-Pcompact3 clean install -DskipTests", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
timeout( time: 120, unit: 'MINUTES' ) {
mavenBuild( "jdk8", "-Pcompact3 clean install -DskipTests", "maven3")
}
}
}
Expand Down Expand Up @@ -130,24 +130,21 @@ def slackNotif() {
* @param cmdline the command line in "<profiles> <goals> <properties>"`format.
* @param consoleParsers array of console parsers to run
*/
def mavenBuild(jdk, cmdline, mvnName, consoleParsers) {
def mavenBuild(jdk, cmdline, mvnName) {
script {
try {
withEnv(["JAVA_HOME=${ tool "$jdk" }",
"PATH+MAVEN=${env.JAVA_HOME}/bin:${tool "$mvnName"}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline -Dunix.socket.tmp=/tmp/unixsocket"
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline -Dunix.socket.tmp=/tmp/unixsocket"
}
}
}
finally
{
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
if(consoleParsers!=null){
warnings consoleParsers: consoleParsers
}
}
}
}
Expand Down
9 changes: 1 addition & 8 deletions examples/pom.xml
Expand Up @@ -14,6 +14,7 @@

<properties>
<sonar.skip>true</sonar.skip>
<spotbugs.skip>true</spotbugs.skip>
</properties>

<build>
Expand All @@ -26,14 +27,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<!-- No Point running Findbugs on example projects -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
8 changes: 1 addition & 7 deletions jetty-alpn/jetty-alpn-client/pom.xml
Expand Up @@ -9,6 +9,7 @@
<name>Jetty :: ALPN :: Client</name>
<properties>
<bundle-symbolic-name>${project.groupId}.alpn.client</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.alpn.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
Expand Down Expand Up @@ -36,13 +37,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.alpn.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down
8 changes: 1 addition & 7 deletions jetty-alpn/jetty-alpn-server/pom.xml
Expand Up @@ -9,6 +9,7 @@
<name>Jetty :: ALPN :: Server</name>
<properties>
<bundle-symbolic-name>${project.groupId}.alpn.server</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.alpn.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
Expand All @@ -18,13 +19,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.alpn.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down
8 changes: 1 addition & 7 deletions jetty-annotations/pom.xml
Expand Up @@ -10,6 +10,7 @@
<description>Annotation support for deploying servlets in jetty.</description>
<properties>
<bundle-symbolic-name>${project.groupId}.annotations</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.annotations.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
Expand All @@ -24,13 +25,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.annotations.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down
8 changes: 1 addition & 7 deletions jetty-client/pom.xml
Expand Up @@ -11,16 +11,10 @@
<properties>
<bundle-symbolic-name>${project.groupId}.client</bundle-symbolic-name>
<jetty.test.policy.loc>target/test-policy</jetty.test.policy.loc>
<spotbugs.onlyAnalyze>org.eclipse.client.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.client.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
8 changes: 1 addition & 7 deletions jetty-continuation/pom.xml
Expand Up @@ -10,16 +10,10 @@
<description>Asynchronous API</description>
<properties>
<bundle-symbolic-name>${project.groupId}.continuation</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.continuation.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.continuation.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down
12 changes: 1 addition & 11 deletions jetty-deploy/pom.xml
Expand Up @@ -10,18 +10,8 @@
<description>Jetty deployers</description>
<properties>
<bundle-symbolic-name>${project.groupId}.deploy</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.deploy.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.deploy.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
Expand Down
9 changes: 1 addition & 8 deletions jetty-distribution/pom.xml
Expand Up @@ -12,6 +12,7 @@
<properties>
<assembly-directory>${basedir}/target/distribution</assembly-directory>
<home-directory>${basedir}/target/home</home-directory>
<spotbugs.skip>true</spotbugs.skip>
</properties>

<build>
Expand Down Expand Up @@ -384,14 +385,6 @@
<skip>true</skip>
</configuration>
</plugin>
<!-- No point performing Findbugs in assembly project -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
9 changes: 1 addition & 8 deletions jetty-home/pom.xml
Expand Up @@ -14,6 +14,7 @@
<assembly-directory>${basedir}/target/jetty-home</assembly-directory>
<source-assembly-directory>${basedir}/target/jetty-home-sources</source-assembly-directory>
<jetty-setuid-version>1.0.4</jetty-setuid-version>
<spotbugs.skip>true</spotbugs.skip>
</properties>

<build>
Expand Down Expand Up @@ -538,14 +539,6 @@
<skip>true</skip>
</configuration>
</plugin>
<!-- No point performing Findbugs in assembly project -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down
8 changes: 1 addition & 7 deletions jetty-http-spi/pom.xml
Expand Up @@ -9,6 +9,7 @@
<name>Jetty :: Http Service Provider Interface</name>
<properties>
<bundle-symbolic-name>${project.groupId}.http.spi</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.http.spi.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -37,13 +38,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.http.spi.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
8 changes: 1 addition & 7 deletions jetty-http/pom.xml
Expand Up @@ -10,6 +10,7 @@
<name>Jetty :: Http Utility</name>
<properties>
<bundle-symbolic-name>${project.groupId}.http</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.http.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -58,13 +59,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.http.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
12 changes: 1 addition & 11 deletions jetty-io/pom.xml
Expand Up @@ -10,6 +10,7 @@
<name>Jetty :: IO Utility</name>
<properties>
<bundle-symbolic-name>${project.groupId}.io</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.io.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
Expand All @@ -23,15 +24,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.io.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
</project>
8 changes: 1 addition & 7 deletions jetty-jaas/pom.xml
Expand Up @@ -12,6 +12,7 @@
<bundle-symbolic-name>${project.groupId}.jaas</bundle-symbolic-name>
<!-- 2.0.0.AM25 is breaking surefire -->
<apacheds.version>2.0.0-M24</apacheds.version>
<spotbugs.onlyAnalyze>org.eclipse.jetty.jaas.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
Expand All @@ -21,13 +22,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.jaas.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down
8 changes: 1 addition & 7 deletions jetty-jaspi/pom.xml
Expand Up @@ -12,17 +12,11 @@

<properties>
<bundle-symbolic-name>${project.groupId}.security.jaspi</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.jaspi.*</spotbugs.onlyAnalyze>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.jaspi.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
Expand Down

0 comments on commit 639cad6

Please sign in to comment.