gpt4 book ai didi

Maven部署错误

转载 作者:行者123 更新时间:2023-12-03 03:13:24 26 4
gpt4 key购买 nike

我有一个包含多个模块的 Maven 项目。需要将所有模块(jar 和一个生成的 war)部署到远程 Artifactory 服务器中。所以在settings.xml中我添加了配置:

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>admin</username>
<password>password</password>
<id>central</id>
</server>
<server>
<username>admin</username>
<password>password</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<id>central</id>
<name>libs-release</name>
<url>http://192.168.1.120:8088/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://192.168.1.120:8088/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://192.168.1.120:8088/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://192.168.1.120:8088/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>

主要 pom 部分:

<distributionManagement>
<repository>
<id>central</id>
<url>http://192.168.1.120:8088/artifactory/libs-release-local</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://192.168.1.120:8088/artifactory/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>

所有模块都有1.0-SNAPSHOT版本。但是在执行命令:>mvn deploy时,出现了以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project jobic: Failed to deploy artifacts: Could not transfer artifact *project-name:project-nam*e:pom:0.0.1 from/to central (http://192.168.1.120:8088/artifactory/libs-release-local): Failed to transfer file: http://192.168.1.120:8088/artifactory/libs-release-local/project-name/project-name/0.0.1/project-name-0.0.1.pom. Return code is: 401 -> [Help 1]

如何处理?

更新:

好的,我明白了。 401 错误显示: 401 = "Unauthorized"。所以我在settings.xml中添加了正确的用户名/密码。看来现在可以工作了。

最后一个问题:我在版本中使用 SNAPSHOT 后缀是对的吗?当我需要将所有模块部署到远程仓库时,这是否适合这种情况?当一个模块损坏而我的同事需要使用该模块的先前版本时,如何处理这种情况?

最佳答案

可能是因为写错了。你可以把hhttp改成http再试一下。

关于Maven部署错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9973613/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com