-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
Jenkins: 2.156
warnings-ng-plugin: 1.0.1
error-prone: 2.3.2
plexus-compiler: 2.8.4
maven: 3.5.4
java: 1.8.0_191
-
Powered by SuggestiMate
Maven build using Error Prone compiler completes with:
channel stopped [Error Prone] Sleeping for 5 seconds due to JENKINS-32191... [Error Prone] Parsing console log (workspace: '/pathtoworkspace/workspace/xxx') [Error Prone] Attaching ResultAction with ID 'error-prone' to run 'xxx #1411'. [Error Prone] Using reference build 'xxx #1410' to compute new, fixed, and outstanding issues [Error Prone] Issues delta (vs. reference build): outstanding: 0, new: 0, fixed: 0 [Error Prone] Evaluating quality gates [Error Prone] -> All quality gates have been passed [Error Prone] Health report is disabled - skipping [Error Prone] Created analysis result for 0 issues (found 0 new issues, fixed 0 issues) Finished: SUCCESS
Inspection of job's log shows entries like the example below:
[pool-1-thread-3 for channel id=36910] WARNING org.apache.maven.plugin.compiler.CompilerMojo - /pathtoworkspace/workspace/xxx/xxx-module/src/main/java/a/path/SomeClass.java:[209,74] [DefaultCharset] Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations. (see https://errorprone.info/bugpattern/DefaultCharset) Did you mean '+ Base64.encodeBase64String(aString.getBytes(UTF_8)) + "')");' or '+ Base64.encodeBase64String(aString.getBytes(Charset.defaultCharset())) + "')");'?
It seems that the warnings are not detected (due to the 'pool-1-thread' or 'org.apache.maven.plugin.compiler.CompilerMojo' stuff?) from console log.
A local build (using the same maven, java and error-prone version) show the warning in the form below:
[WARNING] <pathtoworkspace>/SomeClass.java:[209,74] [DefaultCharset] Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations. (see https://errorprone.info/bugpattern/DefaultCharset) Did you mean '+ Base64.encodeBase64String(aString.getBytes(UTF_8)) + "')");' or '+ Base64.encodeBase64String(aString.getBytes(Charset.defaultCharset())) + "')");'?
So there is obviously a difference in console-log formating.
- is related to
-
JENKINS-72976 Extra logging added to console log on Maven builds and prevent Error-Prone parsing
-
- Closed
-
[JENKINS-55390] No issues found when parsing Error-Prone output from console log during maven build
I neither configurated the maven installation used by jenkins nor my local one related logging ...
It is just a jenkins maven project using an default maven installation (a least I don't configurated anything else).
The start of the project on jenkins looks like:
Parsing POMs Established TCP socket on 46343 maven35-agent.jar already up to date maven35-interceptor.jar already up to date maven3-interceptor-commons.jar already up to date [PROJECT] $ /opt/buildsystem/java/jdk8u191/bin/java -Xms256m -Xmx1280m -cp /opt/buildsystem/data/jenkins2/maven35-agent.jar:/opt/buildsystem/maven/apache-maven-3.5.3/boot/plexus-classworlds-2.5.2.jar:\opt\buildsystem\maven\apache-maven-3.5.4/conf/logging jenkins.maven3.agent.Maven35Main /opt/buildsystem/maven/apache-maven-3.5.4 /opt/buildsystem/jenkins2_node/slave.jar /opt/buildsystem/data/jenkins2/maven35-interceptor.jar /opt/buildsystem/data/jenkins2/maven3-interceptor-commons.jar 46343 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f /opt/buildsystem/data/jenkins2/workspace/xxx/pom.xml clean deploy -P someProfiles [pool-1-thread-3 for channel id=36910] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
Under 'apache-maven-3.5.4/conf/logging' is the default maven 'simplelogger.properties' file located. It contains the content:
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License.org.slf4j.simpleLogger.defaultLogLevel=info org.slf4j.simpleLogger.showDateTime=false org.slf4j.simpleLogger.showThreadName=false org.slf4j.simpleLogger.showLogName=false org.slf4j.simpleLogger.logFile=System.out org.slf4j.simpleLogger.cacheOutputStream=true org.slf4j.simpleLogger.levelInBrackets=true org.slf4j.simpleLogger.log.Sisu=info org.slf4j.simpleLogger.warnLevelString=WARNING# MNG-6181: mvn -X also prints all debug logging from HttpClient # Be aware that the shaded packages are used # org.apache.http -> org.apache.maven.wagon.providers.http.httpclient org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient=off org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient.wire=off
I assumed the different logging on jenkins is part of some 'maven interceptor' magic ... (?!)
Looks like related to https://issues.jenkins-ci.org/browse/JENKINS-19396
Are you using the maven plugin to build the code? Which version are you using?
Indeed. We are using the Maven Integration plugin in version 3.2.
I created a test on our jenkins instance and build the same maven project using jenkins "free style" project type. Doing so resulting in logging comparable to my local build:
[WARNING] <pathtoworkspace>/SomeClass.java:[209,74] [DefaultCharset] Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations. (see https://errorprone.info/bugpattern/DefaultCharset) Did you mean '+ Base64.encodeBase64String(aString.getBytes(UTF_8)) + "')");' or '+ Base64.encodeBase64String(aString.getBytes(Charset.defaultCharset())) + "')");'?
So I think, that the different log format is a result of maven plugin
Interestingly, the error prone tool still found no issue in the console output ?!?
[Error Prone] Sleeping for 5 seconds due to JENKINS-32191... [Error Prone] Parsing console log (workspace: '/pathtoworkspace/workspace/xxx_FreeStyleTest') [Error Prone] Attaching ResultAction with ID 'error-prone' to run 'xxx_FreeStyleTest #1'. [Error Prone] No valid reference build found that meets the criteria (NO_JOB_FAILURE - SUCCESSFUL_QUALITY_GATE) [Error Prone] All reported issues will be considered outstanding [Error Prone] No quality gates have been set - skipping [Error Prone] Health report is disabled - skipping [Error Prone] Created analysis result for 0 issues (found 0 new issues, fixed 0 issues)
It should have recognized the warning above, shouldn't it?
Error prone is supported in Maven only in HEAD currently. The new parser will be part of the 2.0 release.
My log looks completely different. Which version of maven is used in your build?
Started by user Ulli Hafner Building on master in workspace /Users/hafner/Development/jenkins/workspace/New - Maven - Model > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url git@github.com:jenkinsci/analysis-model.git # timeout=10 Fetching upstream changes from git@github.com:jenkinsci/analysis-model.git > git --version # timeout=10 > git fetch --tags --progress git@github.com:jenkinsci/analysis-model.git +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision a065828352ee3ff8648f3358b8dbf005e73833b9 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f a065828352ee3ff8648f3358b8dbf005e73833b9 Commit message: "Merge pull request #79 from CooperRS/patch-1" > git rev-list --no-walk 82331b64c154eac541f49b04aac029f54a6c82a8 # timeout=10 Parsing POMs Modules changed, recalculating dependency graph Established TCP socket on 58840 [New - Maven - Model] $ /Users/hafner/Development/jenkins/tools/hudson.model.JDK/jdk-default/bin/java -cp /Users/hafner/Development/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12.jar:/Users/hafner/Development/jenkins/tools/hudson.tasks.Maven_MavenInstallation/mvn-default/boot/plexus-classworlds-2.5.2.jar:/Users/hafner/Development/jenkins/tools/hudson.tasks.Maven_MavenInstallation/mvn-default/conf/logging jenkins.maven3.agent.Maven35Main /Users/hafner/Development/jenkins/tools/hudson.tasks.Maven_MavenInstallation/mvn-default /Users/hafner/Development/jenkins/war/WEB-INF/lib/remoting-3.27.jar /Users/hafner/Development/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12.jar /Users/hafner/Development/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12.jar 58840 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f /Users/hafner/Development/jenkins/workspace/New - Maven - Model/pom.xml --batch-mode -V -U -e clean verify checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs spotbugs:spotbugs -Dsurefire.useFile=false -Dmaven.test.failure.ignore [1mApache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)[m Maven home: /Users/hafner/Development/jenkins/tools/hudson.tasks.Maven_MavenInstallation/mvn-default Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /Users/hafner/Development/jenkins/tools/hudson.model.JDK/jdk-default/jre Default locale: de_DE, platform encoding: UTF-8 OS name: "mac os x", version: "10.14.2", arch: "x86_64", family: "mac" [[1;34mINFO[m] Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] Downloading from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/apache/maven/plugins/maven-enforcer-plugin/maven-metadata.xml [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-enforcer-plugin/maven-metadata.xml [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-enforcer-plugin/maven-metadata.xml (848 B at 2.7 kB/s) [INFO] Downloaded from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/apache/maven/plugins/maven-enforcer-plugin/maven-metadata.xml (929 B at 1.7 kB/s) [INFO] Downloading from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/jenkins-ci/tools/maven-metadata.xml [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/jenkins-ci/tools/maven-metadata.xml [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml [INFO] Downloading from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/apache/maven/plugins/maven-metadata.xml [INFO] Downloading from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/codehaus/mojo/maven-metadata.xml [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 145 kB/s) [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 kB at 315 kB/s) [INFO] Downloaded from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/jenkins-ci/tools/maven-metadata.xml (414 B at 1.1 kB/s) [INFO] Downloaded from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/apache/maven/plugins/maven-metadata.xml (9.9 kB at 19 kB/s) [INFO] Downloaded from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/codehaus/mojo/maven-metadata.xml (20 kB at 41 kB/s) [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/findbugs-maven-plugin/maven-metadata.xml [INFO] Downloading from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/codehaus/mojo/findbugs-maven-plugin/maven-metadata.xml [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/findbugs-maven-plugin/maven-metadata.xml (1.1 kB at 16 kB/s) [INFO] Downloaded from repo.jenkins-ci.org: https://repo.jenkins-ci.org/public/org/codehaus/mojo/findbugs-maven-plugin/maven-metadata.xml (1.1 kB at 3.5 kB/s) [INFO] [INFO] --------------------< edu.hm.hafner:analysis-model >-------------------- [INFO] Building Static Analysis Model and Parsers 2.0.2-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ analysis-model --- [INFO] Deleting /Users/hafner/Development/jenkins/workspace/New - Maven - Model/target [INFO] [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ analysis-model --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 6 resources [INFO] skip non existing resourceDirectory /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ analysis-model --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 172 source files to /Users/hafner/Development/jenkins/workspace/New - Maven - Model/target/classes [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/YuiCompressorParser.java:[10,30] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/GhsMultiParser.java:[11,30] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/DoxygenParser.java:[11,30] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/NagFortranParser.java:[11,30] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java:[13,30] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/GnuFortranParser.java:[10,30] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/Report.java:[82,44] [ConstructorLeaksThis] Constructors should not pass the 'this' reference out in method invocations, since the object may not be fully constructed. (see https://errorprone.info/bugpattern/ConstructorLeaksThis) [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/Report.java:[100,44] [ConstructorLeaksThis] Constructors should not pass the 'this' reference out in method invocations, since the object may not be fully constructed. (see https://errorprone.info/bugpattern/ConstructorLeaksThis) [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/Report.java:[746,33] [NoFunctionalReturnType] Instead of returning a functional type, return the actual type that the returned function would return and use lambdas at use site. (see https://errorprone.info/bugpattern/NoFunctionalReturnType) [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/IssueBuilder.java:[86,74] [NullAway] passing @Nullable parameter 'fileName' where @NonNull is required (see http://t.uber.com/nullaway ) [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/FilteredLog.java:[112,107] [FormatStringAnnotation] Format strings must be compile time constants or parameters annotated @FormatString: s (see https://errorprone.info/bugpattern/FormatStringAnnotation) [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/YuiCompressorParser.java:[15,42] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/YuiCompressorParser.java:[34,47] [BooleanParameter] Use parameter comments to document ambiguous literals (see https://errorprone.info/bugpattern/BooleanParameter) Did you mean 'super(YUI_COMPRESSOR_WARNING_PATTERN, /* useMultiLine= */true);'? [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/GhsMultiParser.java:[18,37] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/GhsMultiParser.java:[28,42] [BooleanParameter] Use parameter comments to document ambiguous literals (see https://errorprone.info/bugpattern/BooleanParameter) Did you mean 'super(GHS_MULTI_WARNING_PATTERN, /* useMultiLine= */true);'? [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/PackageNameResolver.java:[64,38] [NoFunctionalReturnType] Instead of returning a functional type, return the actual type that the returned function would return and use lambdas at use site. (see https://errorprone.info/bugpattern/NoFunctionalReturnType) [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/util/PathUtil.java:[92,48] [NullAway] passing @Nullable parameter 'directory' where @NonNull is required (see http://t.uber.com/nullaway ) [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/DoxygenParser.java:[20,36] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/DoxygenParser.java:[78,40] [BooleanParameter] Use parameter comments to document ambiguous literals (see https://errorprone.info/bugpattern/BooleanParameter) Did you mean 'super(DOXYGEN_WARNING_PATTERN, /* useMultiLine= */true);'? [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/NagFortranParser.java:[18,39] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/NagFortranParser.java:[29,35] [BooleanParameter] Use parameter comments to document ambiguous literals (see https://errorprone.info/bugpattern/BooleanParameter) Did you mean 'super(NAGFOR_MSG_PATTERN, /* useMultiLine= */true);'? [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java:[21,37] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java:[73,42] [BooleanParameter] Use parameter comments to document ambiguous literals (see https://errorprone.info/bugpattern/BooleanParameter) Did you mean 'super(DR_MEMORY_WARNING_PATTERN, /* useMultiLine= */false);'? [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java:[193,44] [StringSplitter] String.split(String) has surprising behavior (see https://errorprone.info/bugpattern/StringSplitter) Did you mean 'for (String line : Splitter.onPattern("\\r?\\n").split(stackTrace)) {'? [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/GnuFortranParser.java:[17,39] edu.hm.hafner.analysis.RegexpDocumentParser in edu.hm.hafner.analysis has been deprecated [WARNING] /Users/hafner/Development/jenkins/workspace/New - Maven - Model/src/main/java/edu/hm/hafner/analysis/parser/GnuFortranParser.java:[36,37] [BooleanParameter] Use parameter comments to document ambiguous literals (see https://errorprone.info/bugpattern/BooleanParameter) Did you mean 'super(GFORTRAN_MSG_PATTERN, /* useMultiLine= */true);'? [INFO] [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ analysis-model ---
The log looks completely different. How did you configure maven to get it in that way?