List<BuildEvent> () { MavenRunConfiguration configuration = (MavenRunConfiguration)new MavenRunConfigurationType.MavenRunConfigurationFactory(MavenRunConfigurationType.getInstance()) .createTemplateConfiguration(getProject()); CollectConsumer collectConsumer = new CollectConsumer(); MavenLogOutputParser parser = new MavenLogOutputParser(configuration, myTaskId, myParsers); collectConsumer.accept(new StartBuildEventImpl( new DefaultBuildDescriptor(myTaskId, "Maven Run", System.getProperty("user.dir"), System.currentTimeMillis()), "Maven Run")); StubBuildOutputReader reader = new StubBuildOutputReader(myLines); String line; while ((line = reader.readLine()) != null) { parser.parse(line, reader, collectConsumer); } parser.finish(collectConsumer); return collectConsumer.myReceivedEvents; }