gpt4 book ai didi

maven - Sonatype Nexus的Grails Release插件maven-deploy命令失败401错误

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

  • 操作系统:Windows7
  • Grails:2.4.3
  • Sonatype Nexus:2.9.2-01
  • Maven:3、2、3


  • 这个问题解决了!

    原因是错别字。

    在BuildConfig.groovy中

    之前:
    grails.project.repos.myRepo.url = "http://localhost:8081/nexus/content/repositories/snapshots"
    grails.project.repos.myRepo.type = "maven"
    grails.project.repos.myRepo.username = "deployment"
    grails.project.repos.myRepo.password = "deployment123"

    后:
    grails.project.repos.snapshots.url = "http://localhost:8081/nexus/content/repositories/snapshots"
    grails.project.repos.snapshots.type = "maven"
    grails.project.repos.snapshots.username = "deployment"
    grails.project.repos.snapshots.password = "deployment123"

    我忘记了更改repositoryID。

    如果忘记了其中任何一个,请返回401。

    非常感谢!

    我决定将正在开发的插件作为本地Maven存储库托管在Sonatype Nexus上,以在实际安装在独立的Glails应用程序中时检查插件的行为。

    首先,我安装了Maven和Sonatype Nexus。

    马文

    下载zip并将其解压缩到C驱动器下方。
    C:\apache-maven-3.2.3

    接下来,我创建了两个系统属性,并将M2连接到Path。
    M2_HOME
    C:\apache-maven-3.2.3

    M2
    %M2ZHOME%\bin

    Path tail
    ~~~~~~~~%M2%;

    Sonatype Nexus

    下载zip并将其解压缩到C驱动器下方。
    C:\nexus-2.9.2-01-bundle

    然后执行安装并启动命令,nexus webapp已成功启动。

    接下来,我编写了BuildConfig.groovy,即Release插件配置。
    grails.project.repos.snapshots.url = "http://localhost:8081/nexus/content/repositories/snapshots"
    grails.project.repos.myRepo.type = "maven"
    grails.project.repos.myRepo.username = "deployment"
    grails.project.repos.myRepo.password = "deployment123"
    grails.project.repos.default = "snapshots"

    “快照”是从Sonatype Nexus开始就可用的存储库。

    最后,我执行maven-deploy命令并在下面收到一条错误消息。
    | Error Error deploying artifact: Error deploying artifact 'org.grails.plugins:myplugin:zip': Error deploying artifact: Failed to transfer file: http://loca
    lhost:8081/nexus/content/repositories/snapshots/org/grails/plugins/myplugin/
    0.1/myplugin-0.1.zip. Return code is: 401
    | Error Have you specified a configured repository to deploy to (--repository ar
    gument) or specified distributionManagement in your POM?

    我怎么了

    最佳答案

    搜寻Sonatype Nexus 401可为您提供答案:http://blog.sonatype.com/2010/11/what-to-do-when-nexus-returns-401/

    关于maven - Sonatype Nexus的Grails Release插件maven-deploy命令失败401错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26073826/

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