maven - Artifactory OSS在运行maven release时抛出405异常:执行
问题描述
artifactory-oss-6.7.2
405 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]
解决方案
所以我跟着我在这里找到的东西-> 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。虚拟回购有什么意义?
推荐阅读
- ibm-watson - 是否可以通过 MQTT 客户端同时连接多个指定的 IoT Watson 设备?
- javascript - 在 D3.js 中缩放/缩小文本时调整文本大小
- c++ - 检查地址是否可达
- redis - 如何为第三方客户端存储和使用多个用户的密钥
- flutter - 如何删除 DropdownButton 中的高程?
- javascript - 如何防止我的 html 选择标签在每次点击时填充重复数据?
- android - 当父按钮的 onClick 时从 ChildFragment 与父通信
- matrix - 关于pytorch张量计算
- fortran - 意外的 Fortran 逻辑比较
- javascript - 如何将 classList 添加到数组中?