Using antify to run your Play application with ant

Since the version 1.2.2 of Play the antify module has been part of the framework.

Here is how you can run your Play application with ant:

  1. Generate the build.xml file
    /home/huljas/test-app>play antify
    ~        _            _
    ~  _ __ | | __ _ _  _| |
    ~ | '_ \| |/ _' | || |_|
    ~ |  __/|_|\____|\__ (_)
    ~ |_|            |__/
    ~
    ~ play! 1.2.2, http://www.playframework.org
    ~
    ~ OK, a build.xml file has been created
    ~ Define the PLAY_PATH env property, and use it with ant run|start|stop
    ~
    
  2. Set the PLAY_PATH environment variable
    /home/huljas/testapp>export PLAY_PATH=/usr/local/play-1.2.2
    /home/huljas/testapp>echo $PLAY_PATH
    /usr/local/play-1.2.2
    
  3. Now you can run your application with ant!

    Check the main targets:
    /home/huljas/testapp>ant -p
    Buildfile: /home/huljas/testapp/build.xml
    
    Main targets:
    
     auto-test   Automatically run all application tests
     precompile  Compile all java sources and templates
     run         Runs the application
     start       Starts the application as a daemon
     stop        Stop the application daemon
     test        Run the application in test mode
    

    Run you application

    /home/huljas/testapp>ant run
    Buildfile: /home/huljas/testapp/build.xml
    
    run:
        [java] Listening for transport dt_socket at address: 8000
        [java] 23:06:22,366 INFO  ~ Starting /home/huljas/testapp
        [java] 23:06:22,806 WARN  ~ You're running Play! in DEV mode
        [java] 23:06:22,876 INFO  ~ Listening for HTTP on port 9000
    (Waiting a first request to start) ...