private void removeWarpathPlugin(File pom) {
log("Removing maven-warpath-plugin...");
Project antProject = AntUtils.createProject();
ReplaceRegExp regExpTask = (ReplaceRegExp) antProject.createTask("replaceregexp");
regExpTask.setFile(pom);
regExpTask.setMatch("\\s*<plugin>\\s*<groupId>org.appfuse</groupId>(?s:.)*?<artifactId>maven-warpath-plugin</artifactId>(?s:.)*?</plugin>");
regExpTask.setReplace("");
regExpTask.setFlags("g");
regExpTask.execute();
// remove any warpath dependencies as well
ReplaceRegExp regExpTask2 = (ReplaceRegExp) antProject.createTask("replaceregexp");
regExpTask2.setFile(pom);
regExpTask2.setMatch("\\s*<dependency>\\s*<groupId>\\$\\{pom\\.groupId\\}</groupId>(?s:.)*?<type>warpath</type>(?s:.)*?</dependency>");
regExpTask2.setReplace("");
regExpTask2.setFlags("g");
regExpTask2.execute();
ReplaceRegExp regExpTask3 = (ReplaceRegExp) antProject.createTask("replaceregexp");
regExpTask3.setFile(pom);
regExpTask3.setMatch("\\s*<dependency>\\s*<groupId>org.appfuse</groupId>(?s:.)*?<type>warpath</type>(?s:.)*?</dependency>");
regExpTask3.setReplace("");
regExpTask3.setFlags("g");
regExpTask3.execute();
}