【问题标题】:Can I host a container zip on a nexus server for Cargo?我可以在 Cargo 的 nexus 服务器上托管一个容器 zip 吗?
【发布时间】:2015-04-09 02:31:01
【问题描述】:

我们成功地将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 库,以允许我们在不依赖外部网络的情况下运行完整的构建?

【问题讨论】:

  • 你通过 maven 下载的所有东西都可以被 Nexus 代理,所以简单的回答是的。
  • 当您使用 maven '坐标'时确实如此,但 cargo 不将这些用于服务器容器 - 您(可选)提供一个 url,但据我所知,您可以' t 提供坐标。

标签: maven cargo maven-cargo cargo-maven2-plugin


【解决方案1】:

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

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

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

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

【讨论】:

  • 感谢 Fabien - 非常有帮助
猜你喜欢
  • 2011-03-08
  • 1970-01-01
  • 2010-09-22
  • 2011-01-08
  • 2017-07-19
  • 2016-08-24
  • 1970-01-01
  • 2022-08-24
  • 2016-06-23
相关资源
最近更新 更多