使用带有 Apache Ivy 的自定义存储库,找不到解析器 [英] Using a custom repository with Apache Ivy, no resolver found

查看:22
本文介绍了使用带有 Apache Ivy 的自定义存储库,找不到解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎 Apache ivy 只从 http://mvnrepository.com/ 和其他几个地方下载工件,但是那里所有的罐子都过时了.

It seems that Apache ivy downloads artifacts only from http://mvnrepository.com/ and few other places, but all the jars are outdated there.

所以我正在尝试为 Ivy 添加自定义存储库.我正在使用存储库 Ivy RoundUp:http://code.google.com/p/ivyroundup/

So I am trying to add custom repository for Ivy. I am using repository Ivy RoundUp : http://code.google.com/p/ivyroundup/

这是我的配置,但出现错误:

This is my configuration, but getting error:

build.xml:

<target name="update" depends="init-ivy" description="Download project dependencies">
    <!-- edited for brevity -->
    <ivy:settings file="ivysettings.xml" />
    <ivy:retrieve pattern="war/WEB-INF/lib/[artifact]-[revision].[ext]" />
    <!-- edited for brevity -->
</target>

ivy.xml :

<ivy-module version="2.0">
    <info organisation="org.apache" module="hello-ivy"/>
    <dependencies>
        <dependency org="org.springframework" name="spring" rev="3.0.6" conf="default->master"/>

    </dependencies>
</ivy-module>

ivysettings.xml:

ivysettings.xml:

<ivysettings>
    <resolvers>
        <packager name="roundup" buildRoot="${user.home}/.ivy2/packager/build" resourceCache="${user.home}/.ivy2/packager/cache">
            <ivy pattern="http://ivyroundup.googlecode.com/svn/trunk/repo/modules/[organisation]/[module]/[revision]/ivy.xml"/>
            <artifact pattern="http://ivyroundup.googlecode.com/svn/trunk/repo/modules/[organisation]/[module]/[revision]/packager.xml"/>
        </packager>
    </resolvers>
</ivysettings>

错误:

Buildfile: C:\Users\Jansu\workspace\HibernateSpring\build.xml
build:
deploywar:
      [war] Building war: C:\Users\Jansu\workspace\HibernateSpring\hibernate.war
     [copy] Copying 1 file to C:\apache-tomcat-7.0.20\webapps
download-ivy:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
      [get] To: C:\Users\Jansu\.ant\lib\ivy-2.2.0.jar
      [get] Not modified - so not downloaded
init-ivy:
update:
[ivy:retrieve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: file = C:\Users\Jansu\workspace\HibernateSpring\ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: org.apache#hello-ivy;working@Jansu-PC
[ivy:retrieve]  confs: [default]
[ivy:retrieve] :: resolution report :: resolve 110ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      default     |   1   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
[ivy:retrieve] :: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      :: org.springframework#spring;3.0.6: no resolver found for org.springframework#spring: check your configuration
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] 
[ivy:retrieve] :::: ERRORS
[ivy:retrieve]  unknown resolver null
[ivy:retrieve]  no resolver found for org.springframework#spring: check your configuration
[ivy:retrieve] 
[ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

BUILD FAILED
C:\Users\Jansu\workspace\HibernateSpring\build.xml:177: impossible to resolve dependencies:
    resolve failed - see output for details

Total time: 2 seconds

所以它似乎没有找到我的解析器.我确实像自定义存储库要求我那样配置解析器:http://code.google.com/p/ivyroundup/wiki/HowToConfigureIvy

So it seems that it does not find my resolver . I did configure the resolver like the custom repository asked me to: http://code.google.com/p/ivyroundup/wiki/HowToConfigureIvy

这里是该存储库中所有工件的列表,因此您可以看到其中存在 Spring 3.0.6:http://ivyroundup.googlecode.com/svn/trunk/repo/modules.xml

And here is list of all artifacts in that repo, so you can see that Spring 3.0.6 exists in there : http://ivyroundup.googlecode.com/svn/trunk/repo/modules.xml

有什么建议吗?欢迎询问更多信息.

Any suggestions? Feel free to ask more information.

build.properties :

build.properties :

ivy.install.version=2.2.0
ivy.home=${user.home}/.ant
ivy.jar.dir=${ivy.home}/lib
ivy.jar.file=${ivy.jar.dir}/ivy-${ivy.install.version}.jar

推荐答案

Ivyroundup 被设计围绕 ivy 中的 packager resolver.这个解析器非常聪明,展示了 ivy 的真正力量,但世界上大部分人都使用 Maven 存储库来托管他们的软件.事实上,Maven Central 很快将包含近 全球 90% 的 Java 开源组件.

Ivyroundup is designed around the packager resolver in ivy. This resolver is incredibly clever, demonstrates the true power of ivy, but the bulk of the world uses Maven repositories to host their software. Fact is soon Maven Central will contain nearly 90% of the world's Java open source components.

幸运的是,ivy 完全理解 Maven 存储库,这意味着我们可以使用 ivy 作为客户端,并让像 Nexus 托管存储库.这是启用 Maven Central 的设置文件:

Thankfully, ivy fully understands Maven repositories, meaning we can use ivy as a client and let very good products like Nexus host the repository. Here's the settings file that enables Maven Central:

<ivysettings>
  <settings defaultResolver='central'/>
  <resolvers>
    <ibiblio name='central' m2compatible='true'/>
  </resolvers>
</ivysettings>

我强烈建议您考虑设置自己的 Nexus(或 ArtifactoryArchiva...).然后,您可以缓存 Maven 中央工件(更高效)、搜索软件组件并上传和托管由于许可限制(JDBC jar)而无法下载的工件.

I would highly recommend you consider setting up you own local instance of Nexus (Or Artifactory, or Archiva...). You can then cache Maven central artifacts (more efficient), search for software components and upload and host artifacts which cannot be downloaded, due to license restrictions (JDBC jars).

启用本地存储库管理器还使用 ibiblio 解析器,如下所示:

Enabling a local repository manager also uses the ibiblio resolver as follows:

<ivysettings>
  <settings defaultResolver='nexus'/>
  <resolvers>
    <ibiblio name='nexus' m2compatible='true' root='https://nexus.mydomain.com:8081/nexus/content/groups/central/' />
  </resolvers>
</ivysettings>

搜索 Maven 中心(新的常春藤支持功能)

您在寻找 Spring 3.0.6 版本吗?它已经在 Maven 中心:

Searching Maven Central (New ivy support features)

You're looking for the Spring 3.0.6 release? It's already in Maven Central:

http://search.maven.org/#search|ga|1|g%3A%22org.springframework%22%20AND%20v%3A%223.0.6.RELEASE%22

Spring 核心工件的详细信息在这里:

The Spring core artifact details are here:

http://search.maven.org/#artifactdetails|org.springframework|spring-core|3.0.6.RELEASE|jar

搜索页面现在可以方便地为您提供 Maven 和 ivy 客户端声明以复制到您的构建中:

The search page now conveniently gives you both the Maven and ivy client declaration to copy into your build:

<dependency org="org.springframework" name="spring-core" rev="3.0.6.RELEASE" >
    <artifact name="spring-core" type="jar" />
</dependency>

这篇关于使用带有 Apache Ivy 的自定义存储库,找不到解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆