Java 使用带有Apache Ivy的自定义存储库时,未找到解析程序
ApacheIvy似乎只从其他地方下载工件,而很少从其他地方下载工件,但是那里所有的JAR都过时了 因此,我正在尝试为Ivy添加自定义存储库。我正在使用存储库常春藤综述: 这是我的配置,但出现错误: build.xml:Java 使用带有Apache Ivy的自定义存储库时,未找到解析程序,java,ant,build,jar,ivy,Java,Ant,Build,Jar,Ivy,ApacheIvy似乎只从其他地方下载工件,而很少从其他地方下载工件,但是那里所有的JAR都过时了 因此,我正在尝试为Ivy添加自定义存储库。我正在使用存储库常春藤综述: 这是我的配置,但出现错误: build.xml: <target name="update" depends="init-ivy" description="Download project dependencies"> <!-- edited for brevity --> <i
<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>
因此它似乎找不到我的解析器。我确实按照自定义存储库的要求配置了解析器:
下面是该repo中所有工件的列表,因此您可以看到Spring 3.0.6存在于其中:
有什么建议吗?请随时询问更多信息
编辑:
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
更新目标应在ivy:settings之后调用ivy:resolve任务
<target name="update" depends="init-ivy" description="Download project dependencies">
<ivy:settings file="ivysettings.xml" />
<ivy:resolve conf="default" />
<ivy:retrieve pattern="war/WEB-INF/lib/[artifact]-[revision].[ext]" />
</target>
是围绕常春藤设计的。这个解析器非常聪明,展示了常春藤的真正威力,但世界上大部分地区都使用Maven存储库来托管他们的软件。事实是很快Maven Central将包含几乎所有组件
启用Maven存储库
谢天谢地,ivy完全理解Maven存储库,这意味着我们可以使用ivy作为客户机,让非常好的产品(如主机)托管存储库。以下是启用Maven Central的设置文件:
<ivysettings>
<settings defaultResolver='central'/>
<resolvers>
<ibiblio name='central' m2compatible='true'/>
</resolvers>
</ivysettings>
我强烈建议您考虑设置自己的本地实例(或,或……)。然后,您可以缓存Maven central工件(效率更高),搜索软件组件,并上载和托管由于许可证限制(JDBC JAR)而无法下载的工件
启用本地存储库管理器还将使用ibiblio解析器,如下所示:
<ivysettings>
<settings defaultResolver='nexus'/>
<resolvers>
<ibiblio name='nexus' m2compatible='true' root='https://nexus.mydomain.com:8081/nexus/content/groups/central/' />
</resolvers>
</ivysettings>
搜索Maven Central(新的常春藤支持功能)
您正在寻找Spring3.0.6版本?已经在Maven Central了:
<ivysettings>
<settings defaultResolver='central'/>
<resolvers>
<ibiblio name='central' m2compatible='true'/>
</resolvers>
</ivysettings>
Spring核心工件的详细信息如下:
搜索页面现在方便地为您提供Maven和ivy客户端声明,以便复制到构建中:
<dependency org="org.springframework" name="spring-core" rev="3.0.6.RELEASE" >
<artifact name="spring-core" type="jar" />
</dependency>
您必须知道什么是默认解析器,例如,
还是相同的错误,可能是因为我的常春藤缓存和库下载到了{user.home}/.ant。。或者类似的东西。。我在问题中添加了ivy build.properties。哇,谢谢,这很有帮助,我希望你能回答Mark:)现在这不使用ivyroundup,而是使用maven中央图书馆,对吗?这很好,只要有最新的库:)是的,我的示例使用maven central。没有对ivyroundup项目的不敬,但他们总是要迎头赶上。Springsource有他们自己的maven repo,但他们现在已经发布到maven centralOh是的,事实上,只要我得到我的工件,我是否使用ivyroundup或任何其他repo都无所谓。谢谢
<ivysettings>
<settings defaultResolver='nexus'/>
<resolvers>
<ibiblio name='nexus' m2compatible='true' root='https://nexus.mydomain.com:8081/nexus/content/groups/central/' />
</resolvers>
</ivysettings>
<dependency org="org.springframework" name="spring-core" rev="3.0.6.RELEASE" >
<artifact name="spring-core" type="jar" />
</dependency>