I would like Ivy to retrieve both log4j.jar and JavaDocs. Right now, I'm at a standstill. When I use this in my ivy.xml ...
<dependency org="log4j" name="log4j" rev="1.2.16"/>
... then I just get the .jar file. But when using this ivysettings.xml ...
<?xml version="1.0" encoding="UTF-8"?> <ivysettings> <settings defaultResolver="default" defaultConflictManager="all" /> <resolvers> <url name="default" m2compatible="true"> <artifact pattern="http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/> <artifact pattern="http://repo2.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/> </url> </resolvers> </ivysettings>
... and this ivy.xml ...
<?xml version="1.0" encoding="UTF-8"?> <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"> <info organisation="foo" module="bar"/> <dependencies> <dependency org="log4j" name="log4j" rev="1.2.16"> <artifact name="log4j" type="jar" ext="jar"/> <artifact name="log4j" type="javadoc" ext="jar"/> </dependency> </dependencies> </ivy-module>
... then I get this error message: java.lang.RuntimeException: multiple module artifacts log4j # log4j; 1.2.16 are extracted to the same file! Refresh the extraction template to fix this error.
What am I missing here? How can I get Ivy to allow JavaDoc and .jar files?
edit: Thanks for all the quick and detailed answers. This is my updated ivy.xml:
<?xml version="1.0" encoding="UTF-8"?> <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "http://ant.apache.org/ivy/schemas/ivy.xsd"> <info organisation="foo" module="bar"/> <configurations> <conf name="default" visibility="public"/> <conf name="compile" visibility="public"/> <conf name="master" visibility="public"/> <conf name="javadoc" visibility="public"/> </configurations> <dependencies> <dependency org="log4j" name="log4j" rev="1.2.16" conf="default->master,javadoc"/> <dependency org="javax.servlet" name="servlet-api" rev="2.5" /> <dependency org="com.someother" name="proprietary-core" rev="1.2.3" force="true"/> <dependency org="com.someother" name="proprietary" rev="1.2.3" force="true"/> <dependency org="com.someother" name="scanner" rev="1.0" force="true"/> </dependencies> </ivy-module>
Now I get this error message:
Buildfile: D:\workspace\foobar\build.xml resolve: [ivy:retrieve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ :: [ivy:retrieve] :: loading settings :: file = D:\workspace\foobar\ivysettings.xml [ivy:retrieve] :: resolving dependencies :: foo
There seems to be a problem with Maven areas. But what exactly am I missing here?
source share