转移到本地存储的maven安装插件

转移到本地存储的maven安装插件,maven,command-line,offline,nexus,Maven,Command Line,Offline,Nexus,我尝试使用Maven命令行将Windows版本上载到Nexus: mvn deploy:deploy-file -Durl=http://unity.apps.company.net/nexus/content/repositories/idesktopbuildimages-releases/ -DrepositoryId=idesktopbuildimages-releases -DgroupId=images.WINDOWS7X64EnterpriseSP0unattendedcaptur

我尝试使用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 
并得到了错误信息:

下载:

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

发生这种情况是因为我没有Internet访问权限(只有Intranet访问权限)

那么,在我的maven命令中是否有可能转移到本地存储的maven安装插件文件

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

解决方案:
将代理设置添加到my settings.xml如果您没有internet访问权限,我假设您的intranet上有maven central的镜像。如果是这种情况,则必须配置settings.xml来声明镜像。因此,在settings.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>

中央镜
中央回购的本地镜像
http://unity.apps.company.net/nexus/content/repositories/central
中心的
编辑

需要注意的其他事项:您可能需要配置一些代理设置(奇怪的是,它们还没有出现…)


请参见

您必须按照Nexus手册中的说明设置设置文件以访问Nexus的公共组,并确保您的Nexus服务器可以访问Central

公共组的url应为…/nexus/content/groups/public。此默认组中有“中心”存储库

如果您使用的是不同的组(如“版本”),则应确保中央存储库(或旧版Nexus版本中的Maven Central)是有序组存储库列表的一部分,在

设置好后,您可以通过在“存储库”视图中签出代理存储库中心本身来确认可以访问中心存储库,并确认您可以使用中可见的“浏览远程”选项卡访问远程repo


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

我已经有了镜像,但也尝试了您的
http://unity.apps.company.net/nexus/content/repositories/central 地雷:http://unity.apps.company.net/nexus/content/groups/releases
但两者都以相同的警告结束,我一开始就发了。现在我还可以看到一个错误
[error]在当前项目中找不到前缀“deploy”的插件。。插件组[org.apache.maven.plugins,org.codehaus.mojo]可从中央存储库[local(C:\Users\BXXXXXX\.m2\repository]获得(http://repo.maven.apache.org/maven2)]
是否有任何意见(中心不匹配)?请确保镜像url正确。配置Nexus有多种方法,maven插件可能会镜像到其他地方。(通常,可以使用简单的web浏览器浏览镜像存储库)使用此url,我可以浏览自己的存储库,在这里我可以浏览所有存储库,在Maven设置中,它显示“Template ID=unity artifacts”,在那里我找到了以下内容:
${baseurl}content/groups/releases
那么我在上面的评论中发布的应该是正确的吗?当在存储库中更深入地浏览时(在org\apache\maven\plugins\maven install plugin下),你看到安装插件了吗?当搜索“maven install plugin”时,我得到Group=org.apache.maven.plugins,Artifact=maven install plugin和different version,例如,2.4,因此它在防御上是存在的。如何调整settings.xml使其工作?
并且它始终处于活动状态。但是,我如何确定我的Nexus服务器是否可以访问Central?在那里的图片中,我可以看到“Maven Central”-它必须在有序组存储库中吗?我还能查些什么?