使用 Ivy 在 Nexus 中发布时出现凭据错误

Posted

技术标签:

【中文标题】使用 Ivy 在 Nexus 中发布时出现凭据错误【英文标题】:Credentials error when publishing in Nexus with Ivy 【发布时间】:2017-06-21 05:29:42 【问题描述】:

我试图在发布帖子中找到解决问题的方法,但我找不到任何东西(在 *** 和 google 中都没有)

我正在尝试使用 IVY 将一些工件发布到 Nexus,但出现凭据错误。

在我的 ivysettings.xml 中,我定义了凭据标签,但它不能正常工作(我试图放置具体用户并通过但不起作用)。如果我将 /nexus 放在主机值中,如下所示:

<ivysettings>
    <settings defaultResolver="nexus"/>
    <credentials host="$host/nexus" realm="Nexus Repository Manager"
                        username="$user" passwd="$pass"/>

    <property name="nexus-public" value="$nexus.url/content/groups/public"/>
    <property name="nexus-releases" value="$nexus.url/content/repositories/releases"/>
    <property name="nexus-snapshots" value="$nexus.url/content/repositories/ricrepo/"/>
    <property name="nexus-other" value="$nexus.url/content/repositories/releases/"/>


    <resolvers>
            <ibiblio name="nexus" m2compatible="true" usepoms="false" root="$nexus-public"/>
            <ibiblio name="nexus-releases" m2compatible="true" root="$nexus-releases"/>
            <ibiblio name="nexus-other" m2compatible="true" root="$nexus-other"/>
            <ibiblio name="nexus-snapshots" m2compatible="true" root="$nexus-snapshots" checkmodified="true" 
            changingPattern="*-SNAPSHOT"/>
    </resolvers>
</ivysettings>

$host 它只是 $nexus.url 没有 https:// 前缀并且最后没有 /nexus

错误是:

[ivy:publish] INFO: Authentication requested but doAuthentication is disabled
Access to URL MYURL was refused by the server

MYURL 是我与存储库的完整 URL(所以它很好地解析了名称......我认为)

如果我从主机值中删除 de /nexus(ivysettings 如下)

<ivysettings>
    <settings defaultResolver="nexus"/>
    <credentials host="$host" realm="Nexus Repository Manager"
                        username="$user" passwd="$pass"/>

    <property name="nexus-public" value="$nexus.url/content/groups/public"/>
    <property name="nexus-releases" value="$nexus.url/content/repositories/releases"/>
    <property name="nexus-snapshots" value="$nexus.url/content/repositories/ricrepo/"/>
    <property name="nexus-other" value="$nexus.url/content/repositories/releases/"/>


    <resolvers>
            <ibiblio name="nexus" m2compatible="true" usepoms="false" root="$nexus-public"/>
            <ibiblio name="nexus-releases" m2compatible="true" root="$nexus-releases"/>
            <ibiblio name="nexus-other" m2compatible="true" root="$nexus-other"/>
            <ibiblio name="nexus-snapshots" m2compatible="true" root="$nexus-snapshots" checkmodified="true" 
            changingPattern="*-SNAPSHOT"/>
    </resolvers>
</ivysettings>

错误是:

[ivy:publish] INFO: No credentials available for BASIC 'Sonatype Nexus Repository Manager'
Access to URL MYURL was refused by the server

拜托,有人可以帮助我吗?

提前致谢!

【问题讨论】:

【参考方案1】:

尝试将领域设置为“Sonatype Nexus Repository Manager”:

<credentials host="$host" realm="Sonatype Nexus Repository Manager" username="$user" passwd="$pass"/>

【讨论】:

以上是关于使用 Ivy 在 Nexus 中发布时出现凭据错误的主要内容,如果未能解决你的问题,请参考以下文章

常春藤:凭据不会发送到 Nexus

如何使用 ivy 和 nexus 发布 3rdparty 工件

Jenkins 中的 Nexus 凭证与 sbt

使用 Azure 应用服务中托管的 WCF 服务时出现凭据错误

从大查询中获取数据时出现凭据错误

与 Google Drive 集成时出现凭据错误