문제

   <target name="ear" depends="">
        <echo>Building the ear file</echo>
        <copy todir="${build.dir}/META-INF">
            <fileset dir="${conf.dir}" includes="orion-application.xml"/>
        </copy>
        <ear destfile="${dist.dir}/${ant.project.name}.ear" 
                appxml="${conf.dir}/application.xml">
            <fileset dir="${dist.dir}" includes="*.jar,*.war"/>
        </ear>
    </target>

이것을 귀에 추가하는 올바른 방법은 무엇입니까?

도움이 되었습니까?

해결책

개미 귀 작업

들어가야 할 모든 것 META-INF 폴더는 중첩을 통해 지정해야합니다 <metainf> 파일 세트 :

<ear destfile="${dist.dir}/${ant.project.name}.ear" 
  appxml="${conf.dir}/application.xml">
  <metainf dir="${build.dir/META-INF}"/>
  <fileset dir="${dist.dir}" includes="*.jar,*.war"/>
</ear>

다른 팁

이 코드를 시도하십시오 :

    <ear destfile="deploy/iapp.ear"
         appxml="workspace/appEAR/EarContent/META-INF/application.xml">
        <fileset file="workspace/appEJB/appEJB.jar" />
        <fileset file="workspace/appWAR/appWAR.war" />
        <zipfileset file="workspace/appLIB/appLIB.jar"
                    prefix="APP-INF/lib" />
        <zipfileset dir="lib/fop" includes="*.jar" prefix="APP-INF/lib" />
        <zipfileset dir="lib/poi" includes="*.jar" prefix="APP-INF/lib" />
        <zipfileset dir="lib/gxt" includes="*.jar" prefix="APP-INF/lib" />          
        <metainf dir="workspace/appEAR/EarContent/META-INF">
            <exclude name="**/application.xml" />
            <exclude name="**/MANIFEST.MF" />
        </metainf>
        <manifest>
            <attribute name="Weblogic-Application-Version"
                       value="${deploy.revision}" />
        </manifest>
    </ear>

먼저, 이것을 사용하여 전쟁을 세우십시오.

http://ant.apache.org/manual/tasks/war.html

같은 개미 작업의 귀보다.

http://ant.apache.org/manual/tasks/ear.html

이것을 Java 프로젝트 디렉토리 구조에 넣으십시오.

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="test_ear" name="myProject">
    <property name="build.dir" value="WebContent"/>
<target name="test_ear">
    <war destfile="C:/projects/test1.war" needxmlfile='false'>
      <fileset dir="${build.dir}" excludes="*build*.xml"/>
    </war>
    <ear destfile="C:/projects/test1EAR.ear" appxml="WebContent/META-INF/application.xml">
      <fileset dir="C:/projects/" includes="*.jar,*.war"/>
    </ear>
</target>
</project>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top