Hello,
I have a little problem with Ivy for which I have not been able to find a
solution.
it all comes from the fact I can only use java 6 compatible jars, yet some
of the jars down below have different compatibilities.
grizzly 2.3-rc6 (java 6 compatible) depends on javax.servlet-api 3.1-b05
(not java 6 compatible), so I want to use javax.servlet-api 3.1-b02 (java 6
compatible) to circumvent the compatibility issues.
Despite numerous attempts, I have not been able to make this happen.
I have tried to use global excludes, dependency excludes, matcher, version
matchers, but Ivy always manages to download the wrong version of
javax.servlet-api.
I have used the attached files to reproduce this problem.
Does anybody have an idea on how I can modify the files to make it work the
way I want?
Many thanks,
Jean-Noel
<project name="Test" basedir="." default="resolve"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="lib.dir" location="lib"/>
<property name="ivy.install.version" value="2.3.0"/>
<property name="ivy.jar.file" value="${lib.dir}/ivy.jar"/>
<target name="check-ivy-installed">
<available file="${ivy.jar.file}" property="ivy-installed"/>
</target>
<target name="download-ivy" depends="check-ivy-installed" unless="ivy-installed">
<mkdir dir="${lib.dir}"/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<path id="ivy.lib.path">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy">
<ivy:retrieve/>
</target>
<target name="clean" description="--> clean the lib directory">
<delete dir="${lib.dir}"/>
</target>
</project>
<?xml version="1.0"?>
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd">
<info organisation="org.test" module="test"/>
<dependencies>
<dependency org="javax.servlet" name="javax.servlet-api" rev="[3.1-b02]" />
<dependency org="org.glassfish.grizzly" name="grizzly-http-servlet" rev="2.3-rc6" />
</dependencies>
</ivy-module>
<?xml version="1.0" encoding="UTF-8"?>
<ivy-settings>
<settings defaultResolver="main" />
<resolvers>
<chain name="main">
<ibiblio name="central" m2compatible="true"/>
</chain>
</resolvers>
</ivy-settings>