Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Ant Executes and Stops After a Certain Task

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Location
    New Haven
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Ant Executes and Stops After a Certain Task

    Hey, am new to the Javaprogramming forums and I already have a question. I have this project I am trying to build but ant only executes till it reaches the part in bold.

    <project name="RunCommand" default="clean" basedir=".">
    <property name="src" location="src"/>
    <property name="build" location="build"/>
    <property name="dist" location="dist"/>
    <property name="final" location="final"/>

    <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
    </target>

    <target name="compile-dist" depends="init"
    description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}"/>
    </target>

    <target name="dist" depends="compile-dist"
    description="generate the distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}"/>
    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${dist}/RunCommand.jar" basedir="${build}"/>
    </target>

    <target name="move" depends="dist,compile-dist,init">
    <mkdir dir="${final}"/>
    <move todir="${final}">
    <fileset dir="${dist}" includes="*.jar"/>
    </move>
    </target>

    <target name="clean" depends="move,dist,compile-dist,init"
    description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
    </target>
    </project>

    I am just a beginner at programming so the code may be a bit messy. But can someone help me out coz I can't seem to know where the problem is. Thanks.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Ant Executes and Stops After a Certain Task

    Are there any errors shown? How do you know it stops at that line? Add some echo commands in there to see

  3. The Following User Says Thank You to copeg For This Useful Post:

    DanielPros (July 8th, 2011)

  4. #3
    Junior Member
    Join Date
    Jul 2011
    Location
    New Haven
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Ant Executes and Stops After a Certain Task

    Thanks for the reply copeg. No errors are shown, it executes to the point where it builds the project then does nothing else thus showing it doesn't proceed to the distribution target.

  5. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Ant Executes and Stops After a Certain Task

    I just ran the file on a HelloWorld.java and it worked like a charm. Not sure where this might be going wrong, especially if it just freezes. Can you post how you are calling ant, and what the full output is, as well as some idea of your directory structure and project size. Further, have you tried just running the javac of the src directory from the command line (it might give you a better indication of messages/errors)?

Similar Threads

  1. Replies: 5
    Last Post: July 7th, 2011, 09:22 AM
  2. test task for Junior java
    By umami in forum Java Theory & Questions
    Replies: 1
    Last Post: December 2nd, 2010, 10:31 AM
  3. While loop stops.
    By MrFish in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 16th, 2010, 06:40 PM
  4. Check difference between no. of stops, calculate cost
    By JavaStudent23 in forum Java Theory & Questions
    Replies: 4
    Last Post: November 17th, 2009, 03:29 AM
  5. application Task problem - updating JTree
    By idandush in forum AWT / Java Swing
    Replies: 2
    Last Post: June 18th, 2009, 03:15 AM

Tags for this Thread