You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2017/12/31 05:44:00 UTC
[jira] [Commented] (LOG4J2-1937) Including log4j-core yields a
compilation warning with -Xlint:all
[ https://issues.apache.org/jira/browse/LOG4J2-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307093#comment-16307093 ]
Ralph Goers commented on LOG4J2-1937:
-------------------------------------
I suspect this is because of Log4j's annotation processor. I suspect that the presence of any annotation processor will cause this.
> Including log4j-core yields a compilation warning with -Xlint:all
> -----------------------------------------------------------------
>
> Key: LOG4J2-1937
> URL: https://issues.apache.org/jira/browse/LOG4J2-1937
> Project: Log4j 2
> Issue Type: Bug
> Affects Versions: 2.8.2
> Environment: Java 1.8.0_131
> Reporter: Guillaume Dumont
> Attachments: TestProject.zip
>
>
> It seems that starting from log4j2 (2.0+), including {{log4j-core}} to a project that invokes {{javac}} with the option {{-Xlint:all}} will show the warning below for all annotations in the project.
> {noformat}
> warning: No processor claimed any of these annotations: org.junit.Test,org.junit.Rule,org.junit.Ignore,org.junit.Before,org.junit.After
> {noformat}
> I could reproduce it using a small project by putting the following in the gradle file:
> {code}
> dependencies {
> testCompile group: 'junit', name: 'junit', version: '4.11'
> compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0'
> }
> tasks.withType(JavaCompile) {
> options.compilerArgs << "-Xlint:all"
> }
> {code}
> After a lot of research, the only workaround that I've seen suggested is basically to suppress this warning by using {{-Xlint:-processing}} instead. However this warning is definitely triggered by log4j2, which makes me think that this is where the root cause lies. In term of concrete impact, the annotations seem to work correctly.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)