Maven 2 从IVY访问内部maven回购
在这里,我们使用Sonatype Maven存储库。这对于我们的maven项目来说非常好,但是我们有一个遗留应用程序,它使用Ant+IVY进行依赖关系管理,现在需要maven的dep 我的常春藤设置文件如下所示:Maven 2 从IVY访问内部maven回购,maven-2,ivy,Maven 2,Ivy,在这里,我们使用Sonatype Maven存储库。这对于我们的maven项目来说非常好,但是我们有一个遗留应用程序,它使用Ant+IVY进行依赖关系管理,现在需要maven的dep 我的常春藤设置文件如下所示: <ivysettings> <property name="dsnexus-root" value="http://internal-url/" override="false"/> <credentials host="hostname
<ivysettings>
<property name="dsnexus-root" value="http://internal-url/" override="false"/>
<credentials host="hostname" username="username" passwd="XXXX"/>
<!-- ... -->
<resolvers>
<chain name="shared">
<url name="shared-default">
<!-- ... -->
</url>
<url name="dsnexus-public" m2compatible="true">
<artifact pattern="${dsnexus-root}/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
</url>
</chain>
</resolvers>
<modules>
<module organisation=".*" name=".*" resolver="shared"/>
</modules>
<!-- ... -->
</ivysettings>
当然,dep确实存在于该url上
我也试过了
<ibiblio name="dsnexus-public"
root="${dsnexus-root}"
m2compatible="true"
namespace="maven2"/>
得到了同样的结果
我猜是我的凭据有问题。我通常在与nexus通话时使用解析器
<ibiblio name="reponame" m2compatible="true" root="http://nexus-url/reponame"/>
您还应该使用您的凭据指定域,如下所示:
<credentials host="hostname" realm="Sonatype Nexus Repository Manager" username="username" passwd="xxx"/>
在这里,尝试以下操作:
<ivysettings>
<settings defaultResolver="nexus"
checkUpToDate="true" />
<credentials host="localhost"
realm="Sonatype Nexus Repository Manager"
username="admin"
passwd="admin123"/>
<resolvers>
<ibiblio name="nexus" m2compatible="true"
root="http://localhost:8081/nexus/content/groups/public/"/>
<url name="releases" m2compatible="true">
<artifact pattern="http://localhost:8081/nexus/content/repositories/releases/[organization]/[module]/[revision]/[artifact]-[revision].[ext]"/>
<ivy pattern="http://localhost:8081/nexus/content/repositories/releases/[organization]/[module]/[revision]/ivy-[revision].xml"/>
</url>
</resolvers>
</ivysettings>
Nexus1.7.1非常适合我。如果您有任何问题,请告诉我。您是否位于代理服务器后面?纯粹是我的猜测。我正在试图确定为什么ivy无法检索通过web浏览器存在的URL。尝试在详细模式下运行ANT,您将获得更多详细信息,这些信息可能会揭示失败的原因。我将如何发现我想知道的领域的实际名称?
<ivysettings>
<settings defaultResolver="nexus"
checkUpToDate="true" />
<credentials host="localhost"
realm="Sonatype Nexus Repository Manager"
username="admin"
passwd="admin123"/>
<resolvers>
<ibiblio name="nexus" m2compatible="true"
root="http://localhost:8081/nexus/content/groups/public/"/>
<url name="releases" m2compatible="true">
<artifact pattern="http://localhost:8081/nexus/content/repositories/releases/[organization]/[module]/[revision]/[artifact]-[revision].[ext]"/>
<ivy pattern="http://localhost:8081/nexus/content/repositories/releases/[organization]/[module]/[revision]/ivy-[revision].xml"/>
</url>
</resolvers>
</ivysettings>