原因是错字。
在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"
我忘了更改仓库ID。
如果忘记其中任何一个,请返回401。
非常感谢!
我决定在Sonatype Nexus上托管我的开发插件作为本地Maven存储库,以检查实际安装在独立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%;
下载zip并将其解压缩到C盘下方。
C:\nexus-2.9.2-01-bundle
然后执行install and start命令,nexus webapp成功启动。
接下来,我编写了发布插件配置的BuildConfig.groovy。
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?
我错了什么?
答案 0 :(得分:1)
Google搜索Sonatype Nexus 401
为您提供答案:http://blog.sonatype.com/2010/11/what-to-do-when-nexus-returns-401/