【问题标题】:Grape Configuration for Protected Nexus Repository受保护的 Nexus 存储库的葡萄配置
【发布时间】:2014-05-12 15:26:42
【问题描述】:

我的公司使用 Nexus 作为其内部存储库,我正在尝试编写一个 Groovy 脚本来从中提取依赖项。但问题是这个存储库受密码保护。我的 GrapeConfig.xml 文件必须是什么样子才能使其工作?这是我目前拥有的。

<ivysettings>
  <settings defaultResolver="downloadGrapes"/>
    <credentials host="http://prdRepo:18900" 
           realm="prdRepo" 
           username="n"
           passwd="n"
  />

  <resolvers>
    <chain name="downloadGrapes">
      <filesystem name="cachedGrapes">
        <ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
        <artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
      </filesystem>
      <ibiblio name="blahblah" root="http://http://prdRepo:18900/nexus/foo/bar/blahblah m2compatible="true"/>
    </chain>
  </resolvers>
</ivysettings>

然后当我尝试通过命令行安装时

grape -d install com.microsoft msutil 2000

它位于该存储库中,它给了我一个 401 错误,未经授权的 URL。我的 GrapeConfig 是否存在语法错误?

【问题讨论】:

    标签: groovy ivy nexus grape


    【解决方案1】:

    尝试如下设置安全领域:

    <credentials host="prdRepo" realm="Sonatype Nexus Repository Manager" username="????" passwd="????"/>
    

    对于一个有效的常春藤示例, 见:

    补充说明:

    您的 ibiblio 解析器格式不正确且 URL 无效:

    <ibiblio name="blahblah" root="http://http://prdRepo:18900/nexus/foo/bar/blahblah m2compatible="true"/>
    

    试试:

    <ibiblio name="blahblah" root="http://prdRepo:18900/nexus/foo/bar/blahblah" m2compatible="true"/>
    

    【讨论】:

      【解决方案2】:

      由于您仍然使用 http auth,只需将您的 URL 更改为此。 (密码以明文形式发送。)

      http://user:password@prdRepo:18900/nexus/foo/bar/blahblah

      并删除上面的用户名/密码。

      【讨论】:

      • 有人试过吗?不用grapeConfig可以用吗?
      猜你喜欢
      • 2012-06-28
      • 1970-01-01
      • 2017-12-21
      • 2015-06-13
      • 1970-01-01
      • 2014-12-06
      • 2018-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多