简体   繁体   English

没有处理器声明任何这些注释

[英]No processor claimed any of these annotations

Upgraded from java 8 to java 11 and getting below warnings for annotations.Please suggest how to resolve.从 java 8 升级到 java 11 并获得以下注释警告。请建议如何解决。

[WARNING] No processor claimed any of these annotations: 
/org.springframework.context.annotation.Primary,
/org.springframework.data.annotation.Id,
/org.springframework.context.annotation.ComponentScan,
/org.springframework.boot.autoconfigure.SpringBootApplication,
/org.springframework.boot.context.properties.ConfigurationProperties,
/org.springframework.data.mongodb.repository.Query,
/com.fasterxml.jackson.annotation.JsonInclude,
/javax.validation.constraints.NotNull,
/org.springframework.context.annotation.ImportResource,
/org.springframework.web.bind.annotation.DeleteMapping,
/org.springframework.web.bind.annotation.PostMapping

The javac linter has a number of warnings that are really off-the-wall, and you can't turn them off individually. javac linter 有许多非常不寻常的警告,您无法单独关闭它们。 This is one of them.这是其中之一。 I'd suggest using a different linter.我建议使用不同的 linter。

You can't turn off this specific warning, you can only turn off all annotation processor warnings with the -processing flag to -Xlint , eg.您无法关闭此特定警告,您只能关闭所有带有-processing标志为-Xlint注释处理器警告,例如。

-Xlint:all,-serial,-processing

in Maven:在 Maven 中:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
                <showWarnings>true</showWarnings>
                <compilerArgs>
                    <!-- We turn off:
                        - `serial` because we don't use Java serialization 
                          (and all it does is stupidly complain about the serialVersionUID)
                        - `processing` because it complains about every annotation
                    -->
                    <arg>-Xlint:all,-serial,-processing</arg>
                </compilerArgs>
            </configuration>
        </plugin>

You can see all the warnings that will be disable by searching for "warn.proc" in compiler.properties .您可以通过在compiler.properties 中搜索“warn.proc”来查看所有将被禁用的警告。 You can see all linter options with javac --help-lint .您可以使用javac --help-lint查看所有 linter 选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM