我可以在 Cargo 的 nexus 服务器上托管容器 zip 吗?

Can I host a container zip on a nexus server for Cargo?

我们成功地将 cargo-maven2-plugin 与 Jetty 和 Tomcat 容器一起使用。不幸的是,我们的外部互联网连接不稳定,所以我们的构建失败了,因为 cargo 无法访问外部 url 来获取容器 zip:

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start (start-container) on project scc-service-impl: Execution start-container of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start failed: Failed to download
[http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.2.5.v20141112/jetty-distribution-9.2.5.v20141112.tar.gz]:
java.net.UnknownHostException: repo1.maven.org: Unknown host repo1.maven.org -> [Help 1]

是否可以在我们的本地 Nexus 服务器上托管 Tomcat 或 Jetty 库,以允许我们在不依赖外部网络的情况下完整构建到 运行?

Cargo 中使用的容器不被视为依赖项,jetty 是一种特殊情况,因为它存储在 maven 存储库中,因此可以定义为依赖项,但它不会在容器的下载中改变任何内容由 cargo-maven2-plugin.

另一方面,在插件配置中,您可以定义一个containerUrl (see there) or a zipUrlInstaller (see there) 来定义必须从哪里下载容器。

因此,您可以将它下载到您的 Nexus 存储库(或您可能想使用的任何服务器上),并使插件配置中的 URL 指向您的服务器。

如果你检查cargo's main page左栏中的所有容器,你会发现它们并不都存放在同一个地方。