Groovy 受保护的Nexus存储库的Grape配置
我的公司使用Nexus作为其内部存储库,我正试图编写一个Groovy脚本,从中提取依赖项。但问题是此存储库受密码保护。我的GrapeConfig.xml文件必须是什么样子才能使其正常工作?这是我目前拥有的Groovy 受保护的Nexus存储库的Grape配置,groovy,ivy,nexus,grape,Groovy,Ivy,Nexus,Grape,我的公司使用Nexus作为其内部存储库,我正试图编写一个Groovy脚本,从中提取依赖项。但问题是此存储库受密码保护。我的GrapeConfig.xml文件必须是什么样子才能使其正常工作?这是我目前拥有的 <ivysettings> <settings defaultResolver="downloadGrapes"/> <credentials host="http://prdRepo:18900" realm="prdRepo
<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>
它驻留在那个存储库中,它给了我一个401错误,未经授权的URL。我的GrapeConfig在语法上可能有问题吗?尝试如下设置安全域:
<credentials host="prdRepo" realm="Sonatype Nexus Repository Manager" username="????" passwd="????"/>
以常春藤为例,
见:
<ibiblio name="blahblah" root="http://http://prdRepo:18900/nexus/foo/bar/blahblah m2compatible="true"/>
既然您正在使用http身份验证,只需将您的URL更改为此即可。(密码以明文形式发送。)
http://user:password@prdRepo:18900/nexus/foo/bar/blahblah
并删除上面的用户名/密码
<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"/>