tan*_*ens 5 deployment maven-2 nexus
就像在推荐之前的SO-回答我运行的VMware映像secureci含行家,承上启下,哈德森,SVN预配置的开发基础.
现在我想在我的Windows XP机器上配置maven,将其工件部署到nexus.但是当我像这样配置我的pom.xml时(取自部署工件到Nexus):
<distributionManagement>
<!-- use the following if you're not using a snapshot version. -->
<repository>
<id>nexus</id>
<name>RepositoryProxy</name>
<url>scp://192.168.0.197/nexus/content/repositories/releases</url>
</repository>
<!-- use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>nexus</id>
<name>RepositoryProxy</name>
<url>scp://192.168.0.197/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
Run Code Online (Sandbox Code Playgroud)
... mvn deploy打印错误消息:
Error deploying artifact: Exit code: 1 -
mkdir: cannot create directory `/nexus': Permission denied
Run Code Online (Sandbox Code Playgroud)
在settings.xml我配置的用户名和密码如下:
<servers>
<server>
<id>nexus</id>
<username>tangens</username>
<password>********</password>
</server>
</servers>
Run Code Online (Sandbox Code Playgroud)
问题:我必须使用哪种配置来部署到nexus?
我已经尝试过https而不是scp,但是这个maven遇到了缺少证书的问题.
我试过http而不是scp,但secureci安装了防火墙来阻止访问端口80(http),导致超时.
编辑:
我发现nexus将其工件存储在/root/sonatype-work/nexus/storage/snapshots/.但我不喜欢在我的帐号中输入root帐户的凭据settings.xml.
编辑:
问:您是否在Nexus下启用了托管存储库的部署?
是的,它默认启用.
问: Nexus是否正在侦听端口80?
端口80上运行了一个apache.
Server: Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_wsgi/1.3 Python/2.5.2
问:如果防火墙不允许使用HTTP,为什么不直接从"主机"IP添加HTTP连接的例外?
因为我认为SecureCI配置得很好,应该有办法在不调整安装的情况下完成.但也许我在这里太天真了.
Pas*_*ent 12
错误很明显:用户tangens没有/nexus在远程计算机上创建的权限.实际上,您的scp网址不正确,并没有像您提到的那样指向正确的位置.您必须为用户提供tangens正确的权限或配置sshd以允许root连接,但这不是一个好主意.
话虽如此,我认为这不是scpNexus的方法.如果您使用部署scp,则不会通知Nexus部署,并且您的工件将不可见.根据将工件部署到Nexus和第9.4.2章.更新POM: Nexus书的部署配置,必须使用HTTP PUT进行部署.换句话说,您的distributionManagement部分应该如下所示:
<distributionManagement>
...
<repository>
<id>releases</id>
<name>Internal Releases</name>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository>
...
</distributionManagement>
Run Code Online (Sandbox Code Playgroud)
我注意到你说SecureCI使用的防火墙配置为丢弃端口80上的连接.但是,由于我自己没有使用SecureCI,我有一些(可能是愚蠢的)问题:
编辑:根据OP的答案,我认为使用HTTPS可能确实是使用SecureCI的"自然"方式.但是,在通过HTTPS上传之前,您需要将SecureCI的CA证书(证书颁发者的证书)添加到JDK中.您可以按照这些说明执行此操作.但在进一步说明之前,真正的问题是:
如果他们不这样做,我不知道如何在不调整防火墙规则的情况下进行部署.