ivy: prevent downloading sources and .txt files
Asked Answered
S

2

0

How to tell IVY to not download source and .txt files. I have a dependency and it downloads license.txt files with it, when i use soemthing like this

<ivy:cachepath pathid="ivy-src-classpath" conf="compile"/>

it put the .txt files in the classpath which errors out while using java task

Unable to obtain resource from /home/muthiah/Work/ivy/cache/org.apache.commons/com.springsource.org.apache.commons.logging/licenses/license-1.1.1.txt: java.util.zip.ZipException: error in opening zip file
Subordinate answered 6/9, 2010 at 21:56 Comment(0)
C
0

In your ivy.xml file add a configuration mapping to the other module's "default" configuration:

<dependency org="commons-lang" name="commons-lang" rev="2.5" conf="compile->default"/>

Without this mapping you're retrieving both the default and optional dependencies of the remote module.

Another good mapping (for Maven modules) to use is:

conf="compile->master"

This will retrieve the remote artifact without it's transient dependencies.

Cockahoop answered 7/9, 2010 at 20:57 Comment(0)
M
0

I had the same issue with multiple java.util.zip.ZipException: error in opening zip file in my ANT output logs, because there were licence .txt files in the classpath. The solution for me was to update the ivy:cachepath entry by adding type="jar":

<ivy:cachepath pathid="ivy-src-classpath" conf="compile" type="jar"/>

This will restrict only jar files to be added to the classpath.

Mezzorelievo answered 7/9, 2015 at 9:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.