Project antProject = new Project();
try
{
antProject.setBaseDir(MavenTestingUtils.getBasedir());
antProject.setUserProperty("ant.file",buildFile.getAbsolutePath());
DefaultLogger logger = new DefaultLogger();
ConsoleParser parser = new ConsoleParser();
//connList = parser.newPattern(".*([0-9]+\\.[0-9]*\\.[0-9]*\\.[0-9]*):([0-9]*)",1);
connList = parser.newPattern("Jetty AntTask Started",1);
PipedOutputStream pos = new PipedOutputStream();
PipedInputStream pis = new PipedInputStream(pos);
PipedOutputStream pose = new PipedOutputStream();
PipedInputStream pise = new PipedInputStream(pose);
startPump("STDOUT",parser,pis);
startPump("STDERR",parser,pise);
logger.setErrorPrintStream(new PrintStream(pos));
logger.setOutputPrintStream(new PrintStream(pose));
logger.setMessageOutputLevel(Project.MSG_VERBOSE);
antProject.addBuildListener(logger);
antProject.fireBuildStarted();
antProject.init();