运行mvn站点不会在settings.xml中定义的url中查找插件

时间:2015-08-26 07:21:14

标签: maven maven-site-plugin

我一直在尝试使用mvn -s <path_to_settings.xml> site命令生成网站但遇到问题。它说无法解析私有存储库中存在的插件。私有存储库的URL使用settings.xml标记在<pluginRepository>中提供。

在我的settings.xml文件中

<pluginRepositories>
   <pluginRepository>
     <id>pluginRepo</id>
     <url>{URL Of the Repository}</url>
      <releases>
          <enabled>true</enabled>
      </releases>
      <snapshots>
          <enabled>true</enabled>
      </snapshots>
   </pluginRepository>
</pluginRepositories>

最初我认为它可能没有找到正确的设置文件,因此我使用-X标志运行命令,发现它确实正在拾取正确的settings.xml文件并更正了pluginRepository URL。

调试日志的相关输出是

[DEBUG] Reading global settings from <global-settings-path>\settings.xml
[DEBUG] Reading user settings from <my-settings-path>\settings.xml
[DEBUG] Repositories (plugins)     : [
  pluginRepo ({url of private repo}, default, releases+snapshots),
  central (https://repo.maven.apache.org/maven2, default, releases)]

但它给了我错误

Failure to find my-plugin:jar:version in https://repo.maven.apache.org/maven2

但是当我在pom.xml中定义<pluginRepositories>时,命令工作正常。即如果我在我的pom.xml中添加以下内容并运行相同的命令mvn -s <path-to-settings.xml> -X site

<pluginRepositories>
   <pluginRepository>
     <id>pluginRepo1</id>
     <url>{URL Of the Repository}</url>
      <releases>
          <enabled>true</enabled>
      </releases>
      <snapshots>
          <enabled>true</enabled>
      </snapshots>
   </pluginRepository>
</pluginRepositories>

在调试日志中,我有

[DEBUG] Repositories (plugins)     : [
  pluginRepo ({url of private repo}, default, releases+snapshots),
  pluginRepo1 ({url of private repo}, default, releases+snapshots),       
  central (https://repo.maven.apache.org/maven2, default, releases)]

我的问题是:mvn site命令是否在settings.xml中通过pluginRepository定义的URL中查找插件?

0 个答案:

没有答案