使用命令
mvn help:describe -Dplugin=org.apache.maven.plugins:maven-help-plugin
报错
使用命令
mvn help:describe -Dplugin=help
不报错
谁知道怎么回事,跟 版本号没关系,我加上后一样报错
PS D:\eclipse_project\Maven_test> mvn help:describe -Dplugin=org.apache.maven.plugins:maven-help-plugin
[INFO] Scanning for projects...
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/mojo/maven-metadata.xml
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-metadata.xml (11 KB at 7.0 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/mojo/maven-metadata.xml (21 KB at 13.8 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.529 s
[INFO] Finished at: 2023-03-12T13:28:39+08:00
[INFO] Final Memory: 14M/199M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix '.apache.maven.plugins' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\repository), nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
大致意思是本地找不到这个插件,但是我使用命令mvn help:describe -Dplugin=help后会调用maven-help-plugin插件,不知道怎么回事
查看下日志信息里的error和warn
该回答引用GPTᴼᴾᴱᴺᴬᴵ
根据你提供的信息,我猜测可能是命令行参数的问题导致的。对于命令 mvn help:describe -Dplugin=org.apache.maven.plugins:maven-help-plugin,参数 -Dplugin 后面指定了要查询的插件 org.apache.maven.plugins:maven-help-plugin,但是这个插件可能没有被 Maven 配置到当前项目中,所以会报错。而命令 mvn help:describe -Dplugin=help 中的参数 -Dplugin=help 表示要查询的插件是 help,这个插件是 Maven 自带的插件,所以不需要配置就可以直接使用,不会报错。
你可以检查一下项目中是否有配置 org.apache.maven.plugins:maven-help-plugin 插件。如果没有配置,可以通过在 pom.xml 文件中添加以下内容来配置该插件:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
</plugin>
</plugins>
</build>
其中, 标签中的版本号可以根据需要进行修改。完成配置后,你可以再次运行命令 mvn help:describe -Dplugin=org.apache.maven.plugins:maven-help-plugin 查看插件信息。