开发者

Including classes of a path to build a war

开发者 https://www.devze.com 2023-03-07 02:06 出处:网络
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.

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.

  1. create empty war-dir
  2. use ivy.resolveA to create path.projectA, compile, copy classes to war-dir
  3. use ivy.resolveA to create path.projectB, compile, copy classes to war-dir
  4. zip war-dir

If required, use ivy:retrieve to include lib/ in side yor archive.

Jan

0

精彩评论

暂无评论...
验证码 换一张
取 消