如何将 Maven 快照部署到 oss.jfrog.org? Return代码:405

How can I deploy a Maven snapshot to oss.jfrog.org? Return code: 405

还有一个question与此相关,但错误代码不同(409)。

在 pom.xml 文件中我添加了:

<distributionManagement>
    <!-- Release repository -->
    <repository>
        <id>bintray</id>
        <url>https://api.bintray.com/maven/USERNAME/maven/PACKAGE_NAME;publish=1</url>
    </repository>
    <!-- Snapshot repository -->
    <snapshotRepository>
        <id>jfrog-snapshots</id>
        <url>http://oss.jfrog.org/artifactory/libs-snapshot</url>
    </snapshotRepository>
</distributionManagement>

并且 settings.xml 文件包含:

<servers>
    <server>
        <id>bintray</id>
        <username>USERNAME</username>
        <password>API_KEY</password>
    </server>
    <server>
        <id>jfrog-snapshots</id>
        <username>USERNAME</username>
        <password>API_KEY</password>
    </server>
</servers>

该版本已 () 发布到 BinTray,但是当我尝试部署快照时失败并出现以下错误:

Could not transfer artifact GROUP_ID:ARTIFACT_ID:jar:0.4-20150716.145236-1 from/to jfrog-snapshots (http://oss.jfrog.org/artifactory/libs-snapshot): Failed to transfer file: http://oss.jfrog.org/artifactory/libs-snapshot/GROUP_ID/ARTIFACT_ID/0.4-SNAPSHOT/ARTIFACT_ID-0.4-20150716.145236-1.jar. Return code is: 405, ReasonPhrase: Method Not Allowed. -> [Help 1]

libs-snapshot 是一个 virtual repository,您无法将工件部署到其中。
您应该改用 oss-snapshot-local 存储库:

<snapshotRepository>
    <id>jfrog-snapshots</id>
    <url>http://oss.jfrog.org/artifactory/oss-snapshot-local</url>
</snapshotRepository>

有关详细信息,请参阅 Deploying Maven and Gradle snapshots to OJO (oss.jfrog.org)