发生错误原因:
(官方解释:
This error occurs when you employ a plugin that Maven could not download. Possible causes for this error are:
<pluginRepository>
to download the plugin. Note that <repository>
declarations are not considered when looking for the plugin and its dependencies, only <pluginRepositories>
are searched for plugins.${user.home}/.m2/settings.xml
contains a <server>
declaration whose <id>
matches the <id>
of the plugin repository to use. See the Maven Settings Reference for more details.<snapshots><enabled>false</enabled></snapshots>
configured. Likewise, in order to resolve a released version of the plugin, the plugin repository should not be configured with <releases><enabled>false</enabled></releases>
. See the POM Reference for more information on repository configuration.In those cases, check your POM and/or settings for the proper contents. If you configured the plugin repository in a profile of your settings.xml
, also verify that this profile gets actually activated, e.g. via invoking mvn help:active-profiles
.
(翻译:
当您使用Maven无法下载的插件时,会发生此错误。这个错误的可能原因是:
<pluginRepository>
下载插件所需的内容。请注意,<repository>
查找插件及其依赖关系时不考虑声明,只<pluginRepositories>
搜索插件。${user.home}/.m2/settings.xml
包含一个与插件库相匹配的<server>
声明。有关更多详细信息,请参阅Maven设置参考。<id>
<id>
<snapshots><enabled>false</enabled></snapshots>
配置。同样,为了解决插件的发布版本,插件库不应该被配置为<releases><enabled>false</enabled></releases>
。有关存储库配置的更多信息,请参阅POM参考。 在这些情况下,请检查您的POM和/或设置的正确内容。如果您在您的配置文件中配置了插件存储库settings.xml
,还要验证此配置文件是否真正被激活,例如通过调用mvn help:active-profiles
。
如果出现一般网络相关的问题,您也可以参考以下文章:
注意:出于性能原因,Maven缓存插件无法下载的信息。根据您的设置,您可能需要通过将标志添加-U
到命令行来清除此缓存,以使更正生效
)
解决方式:
方式1:使用 mvn clean package -U 打包即可
方式2: 在setting.xml中使用原始中央仓库 就是使用默认的仓库地址