【发布时间】:2015-09-10 21:34:23
【问题描述】:
我有一个包含多个子项目(模块)的项目。更具体地说,这是一个 Eclipse 项目,具有多种功能。
问题是某个功能可能不需要对发布进行任何更改。出于这个原因,我不会提高版本号,但同一个项目中的另一个功能可能会发生变化。由于重新部署相同版本被认为是不好的做法,我在 Nexus 中禁用了该选项。
现在实际问题发生在我部署时。因此,部署任何具有新版本号的东西都可以正常工作,但是在部署旧版本时,我有点期待 maven 会发出警告,说它已经在存储库中退出,然后跳过它,但事实证明 Nexus 会响应:
Return code is: 400, ReasonPhrase:Bad Request.
这会导致 maven 在整个部署过程中失败。完整的错误是:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project xyz: Failed to deploy artifacts: Could not transfer artifact xyz:target:2.5.8.0 from/to nexus (http://host/nexus/content/repositories/releases): Failed to transfer file: http://host/nexus/content/repositories/releases/x/targets/xyz/2.5.8.0/xyz-2.5.8.0.target. Return code is: 400, ReasonPhrase:Bad Request. -> [Help 1]
build 11-Sep-2015 07:09:57 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project abc: Failed to deploy artifacts: Could not transfer artifact foo:abc:jar:2.5.8.0 from/to nexus (http://host/nexus/content/repositories/releases): Failed to transfer file: http://host/nexus/content/repositories/releases/bar/abc/2.5.8.0/abc.ocl-2.5.8.0.jar. Return code is: 400, ReasonPhrase:Bad Request. -> [Help 1]
问题是,我该如何处理这种失败/异常?我想要的是如果它已经部署然后跳过/忽略该工件的部署。
【问题讨论】:
标签: java maven repository nexus