【问题标题】:Artifactory OSS throwing 405 Exception when running maven release:performArtifactory OSS在运行maven release时抛出405异常:执行
【发布时间】:2019-06-30 21:16:39
【问题描述】:

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

在 repo 上从工件“generate settings.xml”创建了一个settings.xml。所有回购都是虚拟回购。在我的项目 pom 文件中添加了 distributionManagement,以使用来自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] [错误] 无法在项目模型上执行目标 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]

【问题讨论】:

    标签: maven exception pom.xml artifactory maven-release-plugin


    【解决方案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。虚拟回购有什么意义?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-21
      • 2015-06-03
      • 2020-01-02
      相关资源
      最近更新 更多