使用 Maven-3 使用 archiva 重新部署时出现 Http 409 错误
我正在将 jar 文件部署到 Maven 存储库 (archiva)
pom.xml :
<distributionManagement>
<repository>
<id>archiva.internal</id>
<uniqueVersion>false</uniqueVersion>
<name>Internal Release Repository</name>
<url>http://server:8080/archiva/repository/internal</url>
</repository>
<snapshotRepository>
<id>archiva.snapshots</id>
<uniqueVersion>false</uniqueVersion>
<name>Internal Snapshot Repository</name>
<url>http://server:8080/archiva/repository/internal/snapshots</url>
</snapshotRepository>
</distributionManagement>
settings.xml:
<servers>
<server>
<id>archiva.internal</id>
<username>user</username>
<password>password</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
<server>
<id>archiva.snapshots</id>
<username>user</username>
<password>password</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
</servers>
第一次 Maven 部署成功,
Uploading: http://server:8080/archiva/repository/internal/com/test/maven-metadata.xml
Uploaded: http://server:8080/archiva/repository/internal/com/test/maven-metadata.xml (306 B at 2.4 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.843s
[INFO] Finished at: Mon Nov 07 17:09:49 EST 2011
[INFO] Final Memory: 5M/11M
如果我尝试重新部署相同的工件,我会得到:
Failed to transfer file: http://server:8080/archiva/repository/internal/com/test.jar. Return code is: 409 -> [Help 1]
是否可以使用相同的版本重新部署相同的工件,或者在重新部署之前我是否必须手动从存档中删除工件?
I am deploying jar file to maven repository (archiva)
pom.xml :
<distributionManagement>
<repository>
<id>archiva.internal</id>
<uniqueVersion>false</uniqueVersion>
<name>Internal Release Repository</name>
<url>http://server:8080/archiva/repository/internal</url>
</repository>
<snapshotRepository>
<id>archiva.snapshots</id>
<uniqueVersion>false</uniqueVersion>
<name>Internal Snapshot Repository</name>
<url>http://server:8080/archiva/repository/internal/snapshots</url>
</snapshotRepository>
</distributionManagement>
settings.xml:
<servers>
<server>
<id>archiva.internal</id>
<username>user</username>
<password>password</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
<server>
<id>archiva.snapshots</id>
<username>user</username>
<password>password</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
</servers>
First maven deploy is success,
Uploading: http://server:8080/archiva/repository/internal/com/test/maven-metadata.xml
Uploaded: http://server:8080/archiva/repository/internal/com/test/maven-metadata.xml (306 B at 2.4 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.843s
[INFO] Finished at: Mon Nov 07 17:09:49 EST 2011
[INFO] Final Memory: 5M/11M
If I try to redeploy the same artifact I get:
Failed to transfer file: http://server:8080/archiva/repository/internal/com/test.jar. Return code is: 409 -> [Help 1]
Is it possible to redeploy the same artifact with the same version, or do I have to manually delete the artifact from archive prior to re-deploy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为管理员,转到存储库页面并编辑托管存储库
内部
- 在那里您可以取消选中阻止重新部署已发布的工件。不过,我一般不会推荐它。一旦有东西存在,就可以下载。下载后,可以通过 Maven 进行缓存。如果你改变它,你不会知道“真正的”版本正在被到处使用。
版本号很便宜——最好使用新的。
As an administrator, go to the repositories page and edit the managed repository
internal
- there you can uncheck Block Re-deployment of Released Artifacts.However, I wouldn't recommend it in general. Once something is there, it can be downloaded. Once it is downloaded, it can be cached by Maven. If you change it, you won't know that the "real" release is being used everywhere.
Version numbers are cheap - it's better to use a new one.