【问题标题】:Ivy: credentials are not sent to Nexus常春藤:凭据不会发送到 Nexus
【发布时间】:2016-10-24 20:14:04
【问题描述】:

我正在使用 Ivy 来构建包含多个组件的项目。我想将这些组件上传到 Nexus 2.6.4

我可以使用curl 和默认用户名和密码将文件发布到 Nexus:

curl -i -v -u deployment:deployment123 --upload-file a.txt http://myserver:8081/nexus/content/repositories/releases/acp/myproject.app/1.0.0.20160622175545/a.txt

这工作得很好!当我在 Nexus UI 上转到系统提要:授权和身份验证部分时,我可以看到成功连接。

当我将密码更改为错误密码时,我可以在授权和身份验证源中看到失败的连接尝试。

但是,当我使用 Ant 构建项目时,我点击了 Unauthorized(听起来像 401)。而且我在 Nexus 提要中完全看不到任何东西(这意味着根据 Nexus 文档没有发送任何凭据)。

ivysettings.xml:

<ivysettings>
    <settings defaultBranch="${ivy.deliver.branch}" defaultResolver="default-chain" />
    <properties file="${ivy.settings.dir}/build.properties" />
    <credentials host="${repo.host}" realm="${repo.realm}"
    username="${repo.user}" passwd="${repo.pass}" />

    <resolvers>
        <filesystem name="local" transactional="true">
        <ivy
            pattern="${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[branch]/[revision]/ivy-[revision].xml" />
            <artifact
            pattern="${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[branch]/[revision]/[type]s/[artifact]-[revision].[ext]" />
        </filesystem>
        <ibiblio name="nexus" m2compatible="true" root="${nexus-public}" />
        <ibiblio name="nexus-releases" m2compatible="true" root="${nexus-releases}" />
        <chain name="default-chain">
            <resolver ref="local" />
            <resolver ref="nexus" />
        </chain>
    </resolvers>
</ivysettings>

build.properties 包含(除其他外):

repo.host=myserver
repo.port=8081
repo.user=deployment
repo.pass=deployment123
repo.realm=Nexus Repository Manager
bundle.publish.resolver=nexus-releases

有什么想法吗?

【问题讨论】:

  • 我认为您的领域可能不正确。试试:“Sonatype Nexus Repository Manager”。
  • 谢谢你,马克。这确实是个问题!
  • 您能否将其发布为答案以便我接受?

标签: ant nexus ivy


【解决方案1】:

领域不正确。正确的值为Sonatype Nexus Repository Manager。该领域不是使用curl 所必需的,但在从 Ant 进行身份验证时是必需的。

【讨论】:

    猜你喜欢
    • 2015-12-16
    • 2011-07-20
    • 2013-09-23
    • 2015-01-24
    • 2016-08-17
    • 2012-09-11
    • 2012-06-18
    • 2011-06-05
    • 2011-04-12
    相关资源
    最近更新 更多