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

sur*_*urm 13 java spring-tool-suite

从 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
Run Code Online (Sandbox Code Playgroud)

Ale*_*sky 19

javac linter 有许多非常奇怪的警告,并且您无法单独关闭它们。这是其中之一。我建议使用不同的 linter。

您无法关闭此特定警告,只能关闭带有标记的所有注释处理器警告 -processing-Xlint例如。

-Xlint:all,-serial,-processing

在 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>
Run Code Online (Sandbox Code Playgroud)

您可以通过在compiler.properties中搜索“warn.proc”来查看将禁用的所有警告。您可以使用 来查看所有 linter 选项javac --help-lint