Plugin validation issues were detected in plugin(s)

huangapple go评论164阅读模式
英文:

Plugin validation issues were detected in plugin(s)

问题

After executing mvn clean verify, 一切都正确编译成功,但也出现以下警告:

[WARNING] 在 7 个插件中检测到插件验证问题:
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.2.0
[WARNING] * org.apache.maven.plugins:maven-jar-plugin:3.2.2
[WARNING] * org.jacoco:jacoco-maven-plugin:0.8.8
[WARNING] * org.apache.maven.plugins:maven-compiler-plugin:3.10.1
[WARNING] * org.codehaus.mojo:build-helper-maven-plugin:3.3.0
[WARNING] * org.apache.maven.plugins:maven-surefire-plugin:2.22.2
[WARNING] * com.mysema.maven:apt-maven-plugin:1.1.3
[WARNING]
[WARNING] 要获取更多或更少的详细信息,请使用'maven.plugin.validation'属性,其中之一的值(不区分大小写):[BRIEF, DEFAULT, VERBOSE]

首先,我不理解这个警告本身,它对我的代码有什么影响等等。
然后如何修复它?最后,如何使用'maven.plugin.validation'属性?我找不到关于这个的文档。

英文:

After executing mvn clean verify everything compiles properly with success, but also I get the following:

[WARNING] Plugin validation issues were detected in 7 plugin(s)
[WARNING] 
[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.2.0
[WARNING]  * org.apache.maven.plugins:maven-jar-plugin:3.2.2
[WARNING]  * org.jacoco:jacoco-maven-plugin:0.8.8
[WARNING]  * org.apache.maven.plugins:maven-compiler-plugin:3.10.1
[WARNING]  * org.codehaus.mojo:build-helper-maven-plugin:3.3.0
[WARNING]  * org.apache.maven.plugins:maven-surefire-plugin:2.22.2
[WARNING]  * com.mysema.maven:apt-maven-plugin:1.1.3
[WARNING] 
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]

Firstly, I don't understand the warning itself, its affection on my code, etc.
Then how to fix that? And lastly, how to use maven.plugin.validaiton property? I couldn't find any docs about this.

答案1

得分: 12

这是一个新功能,用于警告您正在使用的某些插件将来可能无法正常工作。您可以使用简要模式来减少很多噪音,尽管它永远不会完全消失。

mvn package -Dmaven.plugin.validation=brief

您可以在MAVEN_ARGS环境变量中设置此选项,并且它将在所有地方生效,因此除了一个警告"一些插件已过时"之外,不会分散注意力。

export MAVEN_ARGS="-Dmaven.plugin.validation=brief"
英文:

It's a new feature to warn you that some plugin you are using may not work in future. You can make a lot quieter by using the brief mode, though it never goes away completely.

mvn package -Dmaven.plugin.validation=brief

You can set this in the MAVEN_ARGS environment variable and have it picked up everywhere, so apart from a warning "some plugins are out of date" you aren't distracted

export MAVEN_ARGS="-Dmaven.plugin.validation=brief"

答案2

得分: 10

tl;dr - 尝试升级 Maven,对我有效。

我遇到了以下两个警告...

[WARNING]  * org.apache.maven.plugins:maven-compiler-plugin:3.10.1
[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.2.0

...而我的POM中没有配置这两个插件。所以我假设我的Maven安装自动使用了这些插件的旧版本;我在Maven Central确认了这两个插件都有比上面的更新版本;然后我将Maven从3.9.2升级到3.9.3。现在我没有警告,尽管我的POM没有更改。

英文:

tl;dr - Try Upgrading Maven. Worked for me.

I was getting these two Warnings ...

[WARNING]  * org.apache.maven.plugins:maven-compiler-plugin:3.10.1
[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.2.0

... and I did not have either plugin configured in my POM. So I assumed that my installation of Maven was using older versions of those plugins automatically; I confirmed at Maven Central that both plugins had newer versions than the above; and I upgraded Maven from 3.9.2 -> 3.9.3. Now I get no warnings, even though my POM is unchanged.

答案3

得分: 2

Introduced in maven 3.9.x the maven validator shows you plugins that are not maven 4.x compatible. As long as you stay below maven 4.x there will be no impact to your build.

There are two types of reported plugins

Internal

  • using deprecated plugins goals
  • using deprecated plugins parameters
  • using read only plugins parameters

-> users can fix their project by fixing configuration by editing their POMs. Users should consult actual plugin documentation or try to update plugin to newer version.

External

  • using old, deprecated Maven Api by plugin
  • declaring dependencies for Maven Core artifacts in wrong scope in plugin project

-> only fixable by maintainer

Remove message

To remove the message all together you can set locally

mvn -Dmaven.plugin.validation=none

Can be added to MAVEN_OPTS or MAVEN_ARGS environment variables, can
also be added to .mvn/maven.config file in order to configure per
project.

Users can add such property to their settings.xml file to change
configuration globally.

NOTICE as maven.plugin.validation is configuration item for Maven
itself, it can not be used in project pom.xml

Other case insensitive options are as listed in the maven validator documentation:

  • NONE - mute Plugin Validation completely, nothing will be reported
  • INLINE - report only Internal issues in place where occur
  • BRIEF - report only Internal issues in place where occur and list of plugins
    with External issues at the end of build
  • SUMMARY - report list of
    plugins with Internal and External issues at the end of build
  • VERBOSE - report Internal and External issues at the end of build in verbose mode
英文:

Introduced in maven 3.9.x the maven validator shows you plugins that are not maven 4.x compatible. As long as you stay below maven 4.x there will be no impact to your build.

There are two types of reported plugins

Internal

  • using deprecated plugins goals
  • using deprecated plugins parameters
  • using read only plugins parameters

-> users can fix their project by fixing configuration by editing their POMs. Users should consult actual plugin documentation or try to update plugin to newer version.

External

  • using old, deprecated Maven Api by plugin
  • declaring dependencies for Maven Core artifacts in wrong scope in plugin project

-> only fixable by maintainer

Remove message

To remove the message all together you can set locally

mvn -Dmaven.plugin.validation=none

> Can be added to MAVEN_OPTS or MAVEN_ARGS environment variables, can
> also be added to .mvn/maven.config file in order to configure per
> project.
>
> Users can add such property to their settings.xml file to change
> configuration globally.
>
> NOTICE as maven.plugin.validation is configuration item for Maven
> itself, it can not be used in project pom.xml

Other case insensitive options are as listed in the maven validator documentation:

  • NONE - mute Plugin Validation completely, nothing will be reported
  • INLINE - report only Internal issues in place where occur
  • BRIEF - report only Internal issues in place where occur and list of plugins
    with External issues at the and of build
  • SUMMARY - report list of
    plugins with Internal and External issues at the end of build
  • VERBOSE - report Internal and External issues at the end of build in verbose mode

答案4

得分: 1

我将Java版本从8升级到17。为一些我不知道的原因工作了。

英文:

I updated my Java version from 8 to 17. Worked for reasons i dont know

huangapple
  • 本文由 发表于 2023年5月29日 16:51:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76355897.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定