转移到本地存储的 maven-install-plugin



我尝试使用Maven命令行将Windows版本上传到Nexus:

mvn deploy:deploy-file -Durl=http://unity.apps.company.net/nexus/content/repositories/idesktopbuildimages-releases/ -DrepositoryId=idesktopbuildimages-releases -DgroupId=images.WINDOWS7X64EnterpriseSP0unattendedcapture.sources -DartifactId=install -Dversion=6.4 -Dpackaging=wim -Dfile=install.wim 

并得到错误:

下载:http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom

[警告] 无法检索 的插件描述符org.apache.maven.plugins:maven-clean-plugin:2.4.1: 插件org.apache.maven.plugins:maven-clean-plugin:2.4.1 或其之一无法解析依赖项:无法读取项目描述符对于org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1

发生这种情况是因为我无法访问互联网(只能访问内联网)。

那么是否有可能转移到我的 Maven 命令中本地存储的 maven-install-plugin 文件?

PS:我尝试了-DpomFile,但得到了相同的输出。

溶液:

将代理设置添加到我的设置中.xml

如果您无法访问互联网,我假设您的内部网上有 maven central 的镜像。如果是这种情况,则必须配置设置.xml以声明镜像。因此,请在您的设置中添加类似的东西.xml文件:

<mirrors>
  <mirror>
    <id>central-mirror</id>
    <name>Local mirror of central repo</name>
    <url>http://unity.apps.company.net/nexus/content/repositories/central</url>
    <mirrorOf>central</mirrorOf>
  </mirror>
</mirrors>

编辑

其他要看的事情:您可能需要配置一些代理设置(似乎很奇怪它们还没有......

看到这里

您必须设置设置文件才能访问Nexus的公共组,如Nexus书籍中所述,并确保您的Nexus服务器可以访问Central。

公共组的 url 应为 .../nexus/content/groups/public。此默认组中包含"中央"存储库。

如果您使用的是不同的组,例如"版本",则应确保中央存储库(或较旧的Nexus版本中的Maven Central)是有序组存储库列表的一部分,如 http://books.sonatype.com/nexus-book/reference/confignx-sect-managing-groups.html#fig-group-config

设置后,您可以通过在存储库视图中签出代理存储库中心本身来确认可以访问中央存储库,并确认您可以使用 http://books.sonatype.com/nexus-book/reference/confignx-sect-manage-repo.html#fig-repo-config 中显示的"浏览远程"选项卡访问远程存储库

如果此浏览不起作用,则Nexus服务器很可能被内部代理服务器阻止。如果是这种情况,您必须在管理 - 服务器 - 默认 HTTP 代理设置中配置它。

最新更新