So, I am trying to add Ivy to my project that outputs a WAR file. Some dependencies, such as RESTEasy and Jackson, are available while working in JBoss, so I do not want them in my war / WEB-INF / lib folder. Other libraries are not available through JBoss modules, so I want to include them in my project.
** NOTE: In eclipse, I use the edge of a dynamic web module. The idea is to get IvyDE to copy the necessary runtime dependencies to war / WEB-INF / lib.
First I created 2 ivy configuration files:
- ivy.xml - runtime (not included in WAR)
- ivy_web.xml - include in war
Then I used the graphical interface to configure the IDE equivalent of the Ant retrieve task. So, in my Ant build file, which I really don't want to use in my IDE, I have the following:
<ivy:retrieve pattern="war/WEB-INF/lib/[artifact]-[revision].[ext]" file="ivy-web.xml" type="jar" />
<ivy:retrieve pattern="lib/[artifact]-[revision].[ext]" file="ivy.xml" type="jar" />
- image not yet allowed: - (
I noticed in another post ( matching multiple ivy files in Eclipse ), they mention using only 1 ivy.xml - but I'm not quite sure how to get it?
Oh, I also noticed this: IvyDE + WTP: how is it a workaround that the ivy library is ignored by WTP? - however, my project does not use the correct kind of faces, and I would prefer not to add them.
So, after reading this ( https://stackoverflow.com/a/3/4129/ ) post, I added compilation and execution settings to my project. It looks something like this:
<configurations>
<conf name="compile" description="used for building"/>
<conf name="runtime" description="used for running"/>
</configurations>
<dependencies>
<dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="1.9.2" conf="compile->default"/>
<dependency org="org.codehaus.jackson" name="jackson-xc" rev="1.9.2" conf="compile->default"/>
<dependency org="org.codehaus.jackson" name="jackson-jaxrs" rev="1.9.2" conf="compile->default"/>
<dependency org="com.google.guava" name="guava" rev="14.0.1" conf="runtime->default"/>
<dependency org="com.google.inject" name="guice" rev="3.0" conf="runtime->default"/>
<dependency org="aopalliance" name="aopalliance" rev="1.0" conf="runtime->default"/>
<dependency org="javax.inject" name="javax.inject" rev="1" conf="runtime->default"/>
</dependencies>
, ivy.xml. a > Ivy > Retrieve List > Add - Added 2 , , /lib. "runtime" "war/WEB-INF/lib/[] - []. [Ext]" .
, "" /WEB -INF/lib/, , . , .