我是从常春藤缓存中检索一个jar到一个lib文件夹,下面是ivy.xml代码:
<configurations>
<conf name="specificFolder" description="add jar to web-inf/lib folder"/>
</configurations>
<dependencies>
<dependency org="javax.servlet" name="servlet-api" rev="2.4" transitive="false" conf="specificFolder"/>
<dependency org="org.springframework" name="spring-beans" rev="2.5.5" transitive="false" />
<dependency org="org.springframework" name="spring-webmvc" rev="2.5.5" transitive="false" />
<dependency org="org.springframework" name="spring-web" rev="2.5.5" transitive="false" />
<dependency org="org.springframework" name="spring-context" rev="2.5.5" transitive="false" />
<dependency org="org.springframework" name="spring" rev="1.2.6" transitive="false" />
然后这是蚂蚁目标:
<target name="test">
<ivy:retrieve pattern="lib/[artifact](.[ext])" sync="true" type="jar" conf="specificFolder"/>
</target>
但我得到了“未解决的依赖”,这是我做错了什么?
答案 0 :(得分:2)
我重现了您的问题,这是相关的错误消息:
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: javax.servlet#servlet-api;2.4: configuration not found in javax.servlet#servlet-api;2.4: 'specificFolder'. It was required from com.myspotontheweb#demo;????? specificFolder
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
根本原因是以下依赖声明:
<dependency org="javax.servlet" name="servlet-api" ... conf="specificFolder"/>
虽然模块中存在配置,但远程Maven模块中不存在该配置。有关如何查看以下答案的更多详细信息:
<ivy-module version="2.0">
<info organisation="com.myspotontheweb" module="demo"/>
<configurations>
<conf name="specificFolder" description="add jar to web-inf/lib folder"/>
</configurations>
<dependencies>
<dependency org="javax.servlet" name="servlet-api" rev="2.4" conf="specificFolder->master"/>
<dependency org="org.springframework" name="spring-beans" rev="2.5.5" conf="specificFolder->master"/>
<dependency org="org.springframework" name="spring-webmvc" rev="2.5.5" conf="specificFolder->master"/>
<dependency org="org.springframework" name="spring-web" rev="2.5.5" conf="specificFolder->master"/>
<dependency org="org.springframework" name="spring-context" rev="2.5.5" conf="specificFolder->master"/>
<dependency org="org.springframework" name="spring" rev="1.2.6" conf="specificFolder->master"/>
</dependencies>
</ivy-module>
注意: