-->

Deploy SNAPSHOT to oss.jfrog.org (JCenter)

2019-03-02 18:29发布

问题:

I tried doing a mvn deploy for oss.jfrog.org for my project. However I am getting this error:

Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://oss.jfrog.org/simple/oss-snapshot-local/com/myorg/mylibrary/com/myorg/mylibrary/0.0.1-SNAPSHOT/mylibrary-0.0
.1-20141211.050111-1.pom. Return code is: 409, ReasonPhrase: Conflict.
        at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:573)
        at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:493)
        at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:474)
        at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:454)
        at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:871)
        ... 28 more

When I look into the JFrog Repository Browser, I can see that the jar is there withe the correct version, what could be this error, and why is the jar deployed anyway even with this error?

Here's my POM setting:

<distributionManagement>
    <repository>
        <id>bintray-myorg-maven-mylibrary</id>
        <name>artifactory-snapshots</name>
        <url>http://oss.jfrog.org/simple/oss-snapshot-local/com/myorg/mylibrary/</url>
    </repository>
</distributionManagement>

Could it be because of the bintray-* id?

回答1:

simple shouldn't be a part of your URL. Artifactory thinks that simple is the name of the repository and oss-snapshot-local is a part of your groupId. Since pom shows a different groupId, it fails with 409.