首页 > 解决方案 > Artifactory OSS在运行maven release时抛出405异常:执行

问题描述

artifactory-oss-6.7.2405 status code运行 maven release:perform 时抛出异常

settings.xml在 repo 上从工件“生成 settings.xml”创建了一个。所有回购都是虚拟回购。在我的项目 pom 文件中添加了 distributionManagement,以将 id 用于快照和来自settings.xml.

设置.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>

我的项目/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

[信息] [错误] 无法在项目模型上执行目标 org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy):无法部署工件:无法传输工件 com.test:model :jar:0.1.0 from/to central ( http://localhost:8081/artifactory/libs-release ): 传输文件失败http://localhost:8081/artifactory/libs-release/com/srcrea/model/ 0.1.0/model-0.1.0.jar,状态码为 405 -> [帮助 1]

标签: mavenexceptionpom.xmlartifactorymaven-release-plugin

解决方案


所以我跟着我在这里找到的东西-> 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。虚拟回购有什么意义?


推荐阅读