gpt4 book ai didi

maven - 无法在启用 LDAP 的情况下使用加密密码部署 Artifact

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

我们正在使用 Artifactory 版本 4.7.0。我已经为 Artifactory 配置了 LDAP,并且能够成功登录。当我尝试使用加密密码来部署 Artifact 时,它不起作用。在 Artifacts 选项卡中,我单击“Set Me Up”并在输入我的凭据后生成 Maven 设置。然后我下载了 settings.xml 文件,其中包含以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
<id>central</id>
</server>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://artifactory:9090/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://artifactory:9090/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://artifactory:9090/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://artifactory:9090/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>

然后我进入我的个人资料,输入密码并复制加密密码,如下所示:

enter image description here

我将此密码复制到我的settings.xml中,如下所示:

    <server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"AP6FcvsVawZhcfEdZB2PCTrCUZa"}</password>
<id>central</id>
</server>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"AP6FcvsVawZhcfEdZB2PCTrCUZa"}</password>
<id>snapshots</id>
</server>

然后当我尝试部署 Artifact 时,出现以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project more-maven-examples: Failed to deploy artifac
ts: Could not transfer artifact com.infiniteskills.maven:more-maven-examples:jar:1.0 from/to central (http://artifactory:9090/libs-release-local):
Failed to transfer file: http://artifactory:9090/libs-release-local/com/infiniteskills/maven/more-maven-examples/1.0/more-maven-examples-1.0.jar. R
eturn code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

request.log 文件中记录失败的尝试:

20160525143037|9526|REQUEST|10.20.55.124|non_authenticated_user|PUT|/libs-release-local/com/infiniteskills/maven/more-maven-examples/1.0/more-maven-examples-1.0.jar|HTTP/1.1|401|2981
20160525143037|2|REQUEST|10.20.55.124|non_authenticated_user|PUT|/libs-release-local/com/infiniteskills/maven/more-maven-examples/1.0/more-maven-examples-1.0.pom|HTTP/1.1|401|1235

在“安全”>“常规”>“密码加密策略”中,将“密码加密策略”设置为“支持”。此外,密码加密设置为加密。

令人惊讶的是,当我在同一 <server> 的 settings.xml 文件中硬编码我的姓名和 LDAP 密码时 block ,它工作正常。

我做错了什么还是一个错误?

最佳答案

将整行替换为您的凭据

<username>actual-username-here</username>  
<password>your-encrypted-password-here</password>

现在就尝试一下。真是一种享受。

关于maven - 无法在启用 LDAP 的情况下使用加密密码部署 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37433340/

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