安装的Nexus我们的服务器上,并设置快照和版本库。
改变了我的子模块Maven项目的顶级项目的我的pom.xml文件,添加如下几行:
<distributionManagement>
<snapshotRepository>
<id>Snapshots</id>
<url>http://maven:8081/nexus/content/repositories/Snapshots</url>
</snapshotRepository>
<repository>
<id>Releases</id>
<url>http://maven:8081/nexus/content/repositories/Releases</url>
</repository>
</distributionManagement>
我添加了一个Settings.xml以.M2目录包含以下内容:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
-->
<servers>
<server>
<id>Snapshots</id>
<username>user</username>
<password>pass</password>
<privateKey>${user.home}/.ssh/id_dsa</privateKey>
<passphrase>some_passphrase</passphrase>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
<configuration></configuration>
</server>
</servers>
<!--
<mirrors/>
<proxies/>
<profiles/>
<activeProfiles/>
-->
</settings>
当我从月食我的首要项目运行与部署目标行家,行家开始建立和同步(上传)的快照回购。 顶部项目被上传,但第一个子模块建成并开始同步我不断收到后:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project <my sub module project>: Failed to deploy artifacts: Could not transfer artifact <group id>:<artifact id>:xml:0.0.1-20130318.160312-21 from/to Snapshots (http://maven:8081/nexus/content/repositories/Snapshots): Remotely Closed [id: 0x017ae341, /192.168.10.237:58758 :> maven/192.168.10.36:8081]
奇怪的是,如果我浏览我的回购从界面的Nexus子项目是否有使用XML的和jar的等问题,但就是因为错误的Maven的是停止和所有我的其他子项目未部署。
任何人都知道如何解决这个问题?
更新:如果我和distributionManagement标签创建一个Maven项目我可以毫无问题的Nexus部署。 但是,拥有多Maven项目时,我得到的错误。 我试图distributionManagement添加到儿童POM来,但我得到了同样的错误。
在劲歌应该怎么看起来像恩部署到关于distributionManagement标签库?