Including classes of a path to build a war
I try to build a war on a multi modules project without copying the compiled classes. I use Ivy to manage my dependencies between my modules.
The hard thing is to use the result of Ivy report to build the war. My dependencies are translated into a path (classes.path=rootdir/module1/build/classes;rootdir/module2/build/classes;rootdir/module3/build/classes;
). I want to include all the files of that path into the war. It's not working.
To test my build I tried this target. The result is : Warning: skipping zip archive D:\dev\mci\admin\build\dist\admin.war because no files were included.
Any ideas of why it's not working ?
<target name="aaa-zip">
<path id="aaa">
<path path="D:/dev/mci/admin/build/classes"/>
&开发者_高级运维lt;/path>
<ac:pathtofileset name="aaa.fileset"
pathrefid="aaa"
dir="${basedir}"/>
<zip destfile="${build.war.full.filename}">
<mappedresources>
<restrict>
<fileset refid="aaa.fileset"/>
<type type="file"/>
</restrict>
<globmapper from="*" to="WEB-INF/classes/*"/>
</mappedresources>
</zip>
</target>
I don't exactly understand what you are doing and why, so I will just cut short and tell you what's working for me, maybe that will help.
- create empty war-dir
- use ivy.resolveA to create path.projectA, compile, copy classes to war-dir
- use ivy.resolveA to create path.projectB, compile, copy classes to war-dir
- zip war-dir
If required, use ivy:retrieve to include lib/ in side yor archive.
Jan
精彩评论