Using Maven-3 Got Http 409 error when re-deploy with archiva

僤鯓⒐⒋嵵緔 提交于 2019-12-07 06:33:25

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/8043457/using-maven-3-got-http-409-error-when-re-deploy-with-archiva

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!