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 <[email protected]>

record issues

Signed-off-by: olivier lamy <[email protected]>

use warning new generation

Signed-off-by: olivier lamy <[email protected]>

activate errorprone

Signed-off-by: olivier lamy <[email protected]>

fix Jenkinsfile

Signed-off-by: olivier lamy <[email protected]>

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

Signed-off-by: olivier lamy <[email protected]>

junit should allow empty results

Signed-off-by: olivier lamy <[email protected]>

maven console can be use only once...

Signed-off-by: olivier lamy <[email protected]>

one liner

Signed-off-by: olivier lamy <[email protected]>

recordissues only once

Signed-off-by: olivier lamy <[email protected]>

force id

Signed-off-by: olivier lamy <[email protected]>

aggregate results

Signed-off-by: olivier lamy <[email protected]>

configure a name for aggregated reports

Signed-off-by: olivier lamy <[email protected]>

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

Signed-off-by: olivier lamy <[email protected]>

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

Signed-off-by: Joakim Erdfelt <[email protected]>

skip spotbugs for jetty-jmh

Signed-off-by: olivier lamy <[email protected]>

get rid of findbugs as we now have spotbugs

Signed-off-by: olivier lamy <[email protected]>

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 <[email protected]>

make pmd quiet for CI

Signed-off-by: olivier lamy <[email protected]>

remove -fae flag and do not display transfer progress

Signed-off-by: olivier lamy <[email protected]>

try junitParser() to see what it does

Signed-off-by: olivier lamy <[email protected]>

junit parser is a bad idea...

Signed-off-by: olivier lamy <[email protected]>

increase timeout

Signed-off-by: olivier lamy <[email protected]>

no -T2 for javadoc

Signed-off-by: olivier lamy <[email protected]>

fix skip spotbugs and pmd verbose

Signed-off-by: olivier lamy <[email protected]>

* remove -T options

Signed-off-by: olivier lamy <[email protected]>
  • Loading branch information
olamy authored 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 639cad6

Please sign in to comment.