MyEclipse automatic generation of ant BUILD.XM

Source: Internet
Author: User

About MyEclipse automatic generation of the Ant build.xml configuration file, the method of generation is very hidden, it is accidentally found.
Select the project you want to generate the Build.xml file in, right-click. Export-> General, Ant Buildfiles.
Click Next, and then click Finish.

OK, the build is complete. Then you can modify it according to your needs.

Then add the node to generate the war

[HTML]View PlainCopy
  1. <target name="war" depends="Build-project">
  2. <mkdir dir="build/classes"/>
  3. <mkdir dir="dist"/>
  4. <war destfile= "dist/xd.war" webxml="Webroot/web-inf/web.xml">
  5. <fileset dir="WebRoot"/>
  6. <Lib dir="webroot/web-inf/lib"/>
  7. <classes dir="build/classes"/>
  8. </War>
  9. </target>


Attach the build script:

[HTML]View PlainCopy
    1. <? XML version="1.0" ?>
    2. <project name= "AntExample1" default="war">
    3. <path id="Compile.classpath">
    4. <fileset dir="Webcontent/web-inf/lib">
    5. <include name="*.jar"/>
    6. </fileset>
    7. </path>
    8. <target name="init">
    9. <mkdir dir="build/classes"/>
    10. <mkdir dir="dist" />
    11. </target>
    12. <target name="Compile" depends="init" >
    13. <javac destdir="build/classes" debug="true" srcdir="src">
    14. <classpath refid="Compile.classpath"/>
    15. </javac>
    16. </target>
    17. <target name="war" depends="compile">
    18. <war destfile= "dist/antexample.war" webxml="Webcontent/web-inf/web.xml">
    19. <fileset dir="webcontent"/>
    20. <Lib dir="webcontent/web-inf/lib"/>
    21. <classes dir="build/classes"/>
    22. </War>
    23. </target>
    24. <target name="clean">
    25. <delete dir="dist" />
    26. <delete dir="Build" />
    27. </target>
    28. </Project>

MyEclipse automatic generation of ant BUILD.XM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.