Подтвердить что ты не робот

Как включить файл в Jar через Ant в определенном месте

У меня есть задача ant jar:

<target name="jar">
    <jar destfile="${generated.jars.dir}/hello-${environment}.jar">
        <fileset dir="${generated.classes.dir}"/>
        <fileset dir="${environment.dir}/${environment}" includes="config.xml"/>
    </jar>
</target>

Как заставить файл config.xml быть перенесен в конкретный каталог в банке, а не на корневом уровне, например, в /database/config.xml или что-то в этом роде...

PS: Причина в том, что я могу получить hello-local.jar, hello-dev.jar, hello-qa.jar и т.д.

4b9b3361

Ответ 1

Используйте zipfileset следующим образом:

<jar destfile="${generated.jars.dir}/hello-${environment}.jar">
    <fileset dir="${generated.classes.dir}"/>
    <zipfileset dir="${environment.dir}/${environment}" 
                includes="config.xml"
                fullpath="database/config.xml"/>
</jar>

Ответ 2

Вам нужен zipfileset:

<zipfileset dir="${environment.dir}/${environment}" includes="config.xml" prefix="database"/>

или

<zipfileset dir="${environment.dir}/${environment}" includes="config.xml" fullpath="database/config.xml"/>

Ответ 3

<!-- Generate EJBs -->
  <javadoc destdir="${ejb.build.dir}/src" classpathref="ejb.class.path" docletpath="${wl.home}/lib/ejbgen.jar" doclet="weblogic.tools.ejbgen.EJBGen" maxmemory="512m" docletpathref="class.path" failonerror="true" additionalparam="-descriptorDir ${ejb.build.dir}/src/META-INF -wls81 -forceGeneration">
   <fileset dir="${ejb.build.dir}/src" includes="**/ejb/*Bean.java,**/ejb/**/*Bean.java, **/ejb/enterprisemanagement/*EJB.java, **/ejb/sitemanagement/*EJB.java, kaas/gateways/rdm/**" excludes="**/agwmgmt/*.java,**/dstprofilemgmt/*.java, **/KaASBaseSessionBean.java,**/com/hns/iag/kaas/rdm/**">