Several module artifacts in Ivy

I would like to extract the jar to a specific folder (e.g. lib) using ivy, below is the extraction definition in the build.xml file:

<ivy:retrieve pattern="lib/[artifact].[ext]" conf="webInfLib" /> 

And the definition of my ivy.xml as below:

 <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" xmlns:m="http://ant.apache.org/ivy/maven"> <info organisation="xxxx" module="xxxx" status="integration"/> <configurations> <conf name="webInfLib" description="add jar to web-inf/lib folder"/> </configurations> <dependencies> <dependency org="org.springframework" name="spring-beans" rev="2.5.5" transitive="false" conf="webInfLib -> default"/> <dependency org="net.sf.json-lib" name="json-lib" rev="2.3"> <artifact name="json-lib" type="jar" m:classifier="jdk15"/> </dependency> </dependencies> </ivy-module> 

But he always throws:

 impossible to ivy retrieve: java.lang.RuntimeException: Multiple artifacts of the module xxxxxx are retrieved to the same file! Update the retrieve pattern to fix this error. 

I read some similar question, and they suggest changing the extraction pattern to a more complex one. I try something like "[artifact] -revision. [Ext]" but it doesn’t help. And when I execute "ivy.resolve", it works fine. Are there any suggestions on this issue?

+4
source share
1 answer

A return pattern is a problem that is true. You are trying

 [artifact]-[revision].ext 

so I could imagine that the binary jar and the original jar would be written in the same place for any arbitrary dependency. But if you add something unique in case you have

 [artifact]-[revision](-[classifier]).[ext] 

In the case of a source or a document, the classifier will matter and therefore will have a different name. In the absence of a classifier (for example, in the case of a binary compiled jar) there will be no classifier, and this is processed by brackets ()

+4
source

All Articles