play2-maven-plugin/src/main/java/com/google/code/play2/plugin/AbstractAntJavaBasedPlay2Mojo.java
protected Project createProject()
    {
        final Project antProject = new Project();

        final ProjectHelper helper = ProjectHelper.getProjectHelper();
        antProject.addReference( ProjectHelper.PROJECTHELPER_REFERENCE, helper );
        helper.getImportStack().addElement( "AntBuilder" ); // import checks that stack is not empty

        final BuildLogger logger = new NoBannerLogger();

        logger.setMessageOutputLevel( Project.MSG_INFO );
        logger.setOutputPrintStream( System.out );
        logger.setErrorPrintStream( System.err );

        antProject.addBuildListener( logger );

        antProject.init();
        antProject.getBaseDir();
        return antProject;
    }
protected Project createProject()
    {
        final Project antProject = new Project();

        final ProjectHelper helper = ProjectHelper.getProjectHelper();
        antProject.addReference( ProjectHelper.PROJECTHELPER_REFERENCE, helper );
        helper.getImportStack().addElement( "AntBuilder" ); // import checks that stack is not empty

        final BuildLogger logger = new NoBannerLogger();

        logger.setMessageOutputLevel( Project.MSG_INFO );
        logger.setOutputPrintStream( System.out );
        logger.setErrorPrintStream( System.err );

        antProject.addBuildListener( logger );

        antProject.init();
        antProject.getBaseDir();
        return antProject;
    }
Creates and configures Ant project for Java task.

@return Ant project for Java task