I think I donot understand well the conf
feature of ivy even if I have read the tutorial. Think about I have two dependency;
- guava.jar
- foeu.jar
I need foeu.jar
in compile time only but I need guava.jar
not only in compile time but also in runtime. To implement these needs, I have wrote, in ivy.xml;
<configurations defaultconfmapping="runtime->compile">
<conf name="default"
visibility="public" />
<conf name="compile"
visibility="private"/>
<conf name="runtime"
extends="compile"
visibility="public"/>
</configurations>
and, dependency as;
<dependencies>
<dependency org="Google Guava" name="guava-17.0" rev="17.0"
conf="runtime->default"/>
<dependency org="Foeu" name="foeu" rev="5.5.1"
conf="compile->default"/>
</dependencies>
Really, something wrong with conf
understanding of mine. What is the problem and what should I do?
UPDATE:
In build.xml, I am using it like;
ivy-initialization;
<target name="init-ivy" description="Initialize ivy requirements">
<property name="ivy.dep.file" value="${script.directory}/ivy/ivy.xml" />
<ivy:configure file="${script.directory}/ivy/ivyconf.xml"/>
<ivy:resolve/>
<ivy:cachepath pathid="ivy.compile.path" conf="compile" />
<ivy:cachepath pathid="ivy.runtime.path" conf="runtime" />
</target>
compile;
<target name="compile" depends="init-ivy" description="Compiling Java source codes with external libraries">
<javac compiler="javac1.7"
destdir="${class.directory}"
source="1.7"
target="1.7"
failonerror="true"
includeantruntime="false">
<src path="${source.directory}" />
<classpath refid="ivy.compile.path" />
</javac>
</target>
jar
<target name="create-jar" depends="compile" description="Creating jar files">
<jar destfile="${build.directory}/jar/${ant.project.name}.jar"
basedir="${class.directory}">
<manifest>
<attribute name="Main-Class" value="dataScience.management.Management"/>
</manifest>
</jar>
</target>
run
<target name="runtime" depends="create-jar" description="Running Java based application">
<java jar="${jar.directory}/${ant.project.name}.jar"
fork="yes"
maxmemory="400m">
<jvmarg value="-ea"/>
<classpath refid="ivy.runtime.path" />
</java>
</target>