运行 maven release:perform 时,Artifactory OSS 抛出 405 异常

Artifactory OSS throwing 405 Exception when running maven release:perform

artifactory-oss-6.7.2 在 运行 maven release:perform

时抛出 405 status code 异常

在 repo 上从神器 "generate settings.xml" 创建了一个 settings.xml。所有回购都是虚拟回购。将 distributionManagement 添加到我的项目 pom 文件以使用来自 settings.xml 的快照和发布的 id。

settings.xml:

<repositories>
 <repository>
   <snapshots>
     <enabled>false</enabled>
   </snapshots>
   <id>central</id>
   <name>libs-release</name>
   <url>http://localhost:8081/artifactory/libs-release</url>
 </repository>
 <repository>
   <snapshots />
   <id>snapshots</id>
   <name>libs-snapshot</name>
   <url>http://localhost:8081/artifactory/libs-snapshot</url>
  </repository>
 </repositories>

myproject/pom.xml:

     <distributionManagement>
    <repository>
        <id>central</id>
        <name>Artifactory Release Repo</name>
        <url>http://localhost:8081/artifactory/libs-release</url>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <name>Artifactory Snapshot Repo</name>
        <url>http://localhost:8081/artifactory/libs-snapshot</url>
    </snapshotRepository>
</distributionManagement>

run mvn release:perform output:

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project model: Failed to deploy artifacts: Could not transfer artifact com.test:model:jar:0.1.0 from/to central (http://localhost:8081/artifactory/libs-release): Failed to transfer file http://localhost:8081/artifactory/libs-release/com/srcrea/model/0.1.0/model-0.1.0.jar with status code 405 -> [Help 1]

所以我按照我在这里找到的东西 -> http://forums.jfrog.org/Error-Code-405-with-mvn-deploy-td7174367.html

并更新了 pom.xml

的 DistributionManagement
   <distributionManagement>
    <repository>
        <id>central</id>
        <name>Artifactory Release Repo</name>
        <url>http://localhost:8081/artifactory/88888</url>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <name>Artifactory Snapshot Repo</name>
        <url>http://localhost:8081/artifactory/88888</url>
    </snapshotRepository>
</distributionManagement>

重新运行 现在我看到了:

但不清楚的是,为了生成 settings.xml,您需要将虚拟仓库关联到本地仓库。然后生成设置关闭并使用 distributionManagement 配置指向回本地 repo。虚拟仓库的意义何在?