[JIRA] (JENKINS-55911) java lint warning about annotation processor is not recognized

11 views
Skip to first unread message

piotr.zygielo+jenkins.io@gmail.com (JIRA)

unread,
Feb 1, 2019, 9:30:02 AM2/1/19
to jenkinsc...@googlegroups.com
Piotrek Zygielo created an issue
 
Jenkins / Bug JENKINS-55911
java lint warning about annotation processor is not recognized
Issue Type: Bug Bug
Assignee: Ulli Hafner
Components: warnings-ng-plugin
Created: 2019-02-01 14:29
Environment: jenkins: 2.162
warnings-ng-plugin: 2.1.2
analysis-model-api-plugin: 2.0.2
openjdk version "1.8.0_191"
Priority: Minor Minor
Reporter: Piotrek Zygielo

maven build warning:

[INFO] -------------------------------------------------------------
[WARNING] Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'
[INFO] 1 warning

from javac -Xlint is not recognized/reported by plugin.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 1, 2019, 10:56:01 AM2/1/19
to jenkinsc...@googlegroups.com

piotr.zygielo+jenkins.io@gmail.com (JIRA)

unread,
Feb 1, 2019, 11:05:02 AM2/1/19
to jenkinsc...@googlegroups.com

Which parser?

Java:

<io.jenkins.plugins.analysis.core.steps.IssuesRecorder plugin="warni...@2.1.2">
 <analysisTools>
  <io.jenkins.plugins.analysis.warnings.Java>

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 1, 2019, 11:33:02 AM2/1/19
to jenkinsc...@googlegroups.com

I see, the format is totally different. Shouldn’t it make more sense if such warnings will be rather catched by the maven parser only?

piotr.zygielo+jenkins.io@gmail.com (JIRA)

unread,
Feb 1, 2019, 12:51:02 PM2/1/19
to jenkinsc...@googlegroups.com

 

I see, the format is totally different

 
Right, sadly it is. But it is emitted by javac, and only with `-Xlint` option used.
The result from command line call:

 

$ javac -Xlint -Xlint:-processing -cp ../glassfish-embedded-all-5.1.0.jar:../jakarta.ejb-api-3.2.5.jar:../api.jar src/main/java/.../XXX.java 
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'

Also - I could not find any way of explicitly disabling this check/warning, and have other still enabled. (After all the end result is as I want - it is effectively ignored...)

It seems this warning was not fully linted/integrated to -Xlint option (https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7184902 and others).

Shouldn’t it make more sense if such warnings will be rather catched by the maven parser only?

I reported this, with expectation that e.h.h.a.p.JavacParser was supposed to catch it.
My assumption could be wrong, or for any other reason it could be not feasible to add it to JavacParser.

Unfortunately, with two tools configured (Java, Maven) or Maven alone - in Maven Warnings report, some other warnings are correctly collected, but not this one - it is not present at all.

For example, from console
 

[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ integration-tests ---
[INFO] ShortRevision tag detected. The value is '8'.
[INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD'
[INFO] Working directory: .../integration-tests
[INFO] Storing buildNumber: 20190201.183514-r369adafc at timestamp: 1549042514164
[WARNING] Cannot get the branch information from the git repository: 
Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref

[INFO] ShortRevision tag detected. The value is '8'.
[INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD'
[INFO] Working directory: .../integration-tests
[INFO] Storing buildScmBranch: UNKNOWN
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ integration-tests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory .../integration-tests/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ integration-tests ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to .../target/classes
[WARNING] Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'
[INFO] ------------------------------------------------------------------------

the 1st warn (Cannot get the branch...) is present, and the 2nd (Supported source...) is not.

piotr.zygielo+jenkins.io@gmail.com (JIRA)

unread,
Feb 1, 2019, 12:52:01 PM2/1/19
to jenkinsc...@googlegroups.com
Piotrek Zygielo edited a comment on Bug JENKINS-55911
 
{quote}I see, the format is totally different
{quote}

 
Right, sadly it is. But it is emitted by javac, and only with `-Xlint` option used.
The result from command line call:

 
{code :java }

$ javac -Xlint -Xlint:-processing -cp ../glassfish-embedded-all-5.1.0.jar:../jakarta.ejb-api-3.2.5.jar:../api.jar src/main/java/.../XXX.java
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'
{code}

Also - I could not find any way of explicitly disabling this check/warning, and have other still enabled. (After all the end result is as I want - it is effectively ignored...)

It seems this warning was not fully _linted_/integrated to -Xlint option ([https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7184902] and others).
{quote}Shouldn’t it make more sense if such warnings will be rather catched by the maven parser only?
{quote}

I reported this, with expectation that {{e.h.h.a.p.JavacParser}} was supposed to catch it.
My assumption could be wrong, or for any other reason it could be not feasible to add it to {{JavacParser}}.

Unfortunately, with two tools configured (Java, Maven) or Maven alone - in *Maven Warnings* report, some other warnings are correctly collected, but not this one - it is not present at all.

For example, from console
 

{noformat}

[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ integration-tests ---
[INFO] ShortRevision tag detected. The value is '8'.
[INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD'
[INFO] Working directory: .../integration-tests
[INFO] Storing buildNumber: 20190201.183514-r369adafc at timestamp: 1549042514164
[WARNING] Cannot get the branch information from the git repository:
Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref

[INFO] ShortRevision tag detected. The value is '8'.
[INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD'
[INFO] Working directory: .../integration-tests
[INFO] Storing buildScmBranch: UNKNOWN
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ integration-tests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory .../integration-tests/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ integration-tests ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to .../target/classes
[WARNING] Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'
[INFO] ------------------------------------------------------------------------
{noformat}

the 1st warn (_Cannot get the branch..._) is present, and the 2nd (_Supported source..._) is not.

Probably due to [https://github.com/jenkinsci/analysis-model/blob/0e953832b82e0f8d611b84a30146cbb00b9f0ea7/src/main/java/edu/hm/hafner/analysis/parser/MavenConsoleParser.java#L73]?

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 1, 2019, 3:44:01 PM2/1/19
to jenkinsc...@googlegroups.com

When this option is part of javac then it is better suited for the javac parser. I think I need to add some tweaks to the regexp so it gets picked up as well.

piotr.zygielo+jenkins.io@gmail.com (JIRA)

unread,
Feb 2, 2019, 2:12:02 AM2/2/19
to jenkinsc...@googlegroups.com

Just to make it complete of all I know.
My latest finding is:

This warning is produced by javac, but it is not from compiler, but rather from annotation processor. Thus turning off a. processing (-proc:none) - if one does not need it - frees console from this message.

I didn't find separate analysisTool for [non-existing today] apt (which functionality I guess was merged into javac in 1.8, and apt itself was removed from JDK). Maybe new tool could be created, to parse annotation processing results? Just idea.

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 21, 2019, 5:45:02 PM2/21/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
 
Change By: Ulli Hafner
Labels: help-wanted newbie-friendly

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 21, 2019, 5:46:03 PM2/21/19
to jenkinsc...@googlegroups.com
Ulli Hafner assigned an issue to Unassigned
Change By: Ulli Hafner
Assignee: Ulli Hafner

ullrich.hafner@gmail.com (JIRA)

unread,
Jun 17, 2019, 5:15:01 PM6/17/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
Change By: Ulli Hafner
Component/s: analysis-model
Component/s: warnings-ng-plugin

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 22, 2020, 1:06:02 PM3/22/20
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
Change By: Ulli Hafner
Labels: help-wanted newbie-friendly testing-course
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

ullrich.hafner@gmail.com (JIRA)

unread,
Apr 29, 2020, 10:41:04 AM4/29/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages