1、打开ivy-settings.xml
可以发现很多地方增加了远程仓库的配置,假设远程仓库的主机名为remote.server。
<resolvers>
<ibiblio name="sonatype-releases" root="http://remote.server:8081/nexus/content/repositories/proxy-repositories" m2compatible="true" />
<ibiblio name="maven.restlet.org" root="http://remote.server:8081/nexus/content/repositories/proxy-repositories" m2compatible="true" />
<ibiblio name="releases.cloudera.com" root="http://remote.server:8081/nexus/content/repositories/proxy-repositories" m2compatible="true" />
<!-- you might need to tweak this from china so it works -->
<ibiblio name="working-chinese-mirror" root="http://remote.server:8081/nexus/content/repositories/proxy-repositories" m2compatible="true" />
2、在<ivysettings>标签下,增加远程仓库访问的用户名和密码配置即可。
<ivy:configure>
<credentials host="remote.server" realm="Sonatype Nexus Repository Manager" username="wkh" passwd="secret"/>
</ivy:configure>
网友评论