就像之前的 SO-Answer 中推荐的那样,我正在运行 Secureci 的 VmWare 映像作为包含 maven、nexus、hudson、svn 的预配置开发基础架构。
现在我想在我的 Windows XP 机器上配置 maven 以将其工件部署到 nexus。但是当我像这样配置我的 pom.xml 时(取自Deploying Artifacts to 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>
...mvn deploy
打印错误消息:
Error deploying artifact: Exit code: 1 -
mkdir: cannot create directory `/nexus': Permission denied
在settings.xml
我这样配置用户名和密码:
<servers>
<server>
<id>nexus</id>
<username>tangens</username>
<password>********</password>
</server>
</servers>
问题:我必须使用什么配置来部署到 nexus?
我已经尝试过https
代替scp
,但是使用这个 maven 时遇到了缺少证书的问题。
我试过http
代替scp
,但secureci安装了防火墙来阻止对端口80(http)的访问,导致超时。
编辑:
我发现 nexus 将其工件存储在/root/sonatype-work/nexus/storage/snapshots/
. 但我不喜欢在我的settings.xml
.
编辑:
问:您是否为 Nexus 下的托管存储库启用了部署?
是的,它默认启用。
问: Nexus 是否监听 80 端口?
有一个 apache 在端口 80 上运行。
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 配置良好,并且应该有一种方法可以在不调整安装的情况下做到这一点。但也许我在这里太天真了。