Buggy code:
public class WebAppMojo extends AbstractMojo { protected MavenProject m_project ; protected File baseDir ; protected Generator m_generator ; protected XmlAggregator m_aggregator ; protected WizardMeta m_wizardMeta ; protected String sourceDir ; protected String manifest ; protected String resourceBase ; protected boolean verbose ; protected boolean debug ; protected String m_resourceFolder = "src//main//resources" ; public Template buildTemplate ( File templateFile , String moduleName , String pageName ) throws Exception { } protected Wizard buildWizard ( File wizardFile ) throws IOException , SAXException { } public void execute ( ) throws MojoExecutionException , MojoFailureException { } protected File getFile ( String path ) { } protected String getPackageName ( ) { } protected void modifyPomFile ( File pomFile , Wizard wizard , Webapp webapp ) throws Exception { Document doc = new SAXBuilder ( ) . build ( pomFile ) ; Element root = doc . getRootElement ( ) ; PomFileBuilder b = new PomFileBuilder ( ) ; Element dependencies = b . findOrCreateChild ( root , "dependencies" ) ; Element packaging = b . findChild ( root , "packaging" ) ; String projectType = ( packaging == null ) ? "jar" : packaging . getText ( ) ; if ( ( ! ( webapp . isModule ( ) ) ) && ( "jar" . equals ( projectType ) ) ) { boolean war = PropertyProviders . fromConsole ( ) . forBoolean ( "war" , "Is<seq2seq4repair_space>it<seq2seq4repair_space>a<seq2seq4repair_space>web<seq2seq4repair_space>project?" , true ) ; if ( war ) { getLog ( ) . info ( String . format ( "Change<seq2seq4repair_space>project<seq2seq4repair_space>packaging<seq2seq4repair_space>type<seq2seq4repair_space>from<seq2seq4repair_space>%s<seq2seq4repair_space>to<seq2seq4repair_space>war." , projectType ) ) ; b . findOrCreateChild ( root , "packaging" , "dependencies" , null ) . setText ( "war" ) ; } else { wizard . getWebapp ( ) . setModule ( true ) ; } } if ( ! ( b . checkDependency ( dependencies , "org.unidal.framework" , "web-framework" , "2.1.2" , null ) ) ) { if ( webapp . isJstl ( ) ) { b . checkDependency ( dependencies , "javax.servlet" , "jstl" , "1.2" , null ) ; } if ( webapp . isWebres ( ) ) { b . checkDependency ( dependencies , "org.unidal.webres" , "WebResServer" , "1.2.1" , null ) ; } b . checkDependency ( dependencies , "javax.servlet" , "servlet-api" , "2.5" , "provided" ) ; b . checkDependency ( dependencies , "junit" , "junit" , "4.8.1" , "test" ) ; b . checkDependency ( dependencies , "org.unidal.framework" , "foundation-service" , "2.1.1" , null ) ; b . checkDependency ( dependencies , "org.unidal.framework" , "test-framework" , "2.1.0" , "test" ) ; b . checkDependency ( dependencies , "org.mortbay.jetty" , "jetty" , "6.1.14" , "test" ) ; b . checkDependency ( dependencies , "org.mortbay.jetty" , "jsp-2.1" , "6.1.14" , "test" ) ; } Element build = b . findOrCreateChild ( root , "build" , null , "dependencies" ) ; if ( webapp . isPluginManagement ( ) ) { Element pluginManagement = b . findOrCreateChild ( build , "pluginManagement" ) ; Element pluginManagementPlugins = b . findOrCreateChild ( pluginManagement , "plugins" ) ; Element compilerPlugin = b . checkPlugin ( pluginManagementPlugins , null , "maven-compiler-plugin" , "2.5.1" ) ; Element compilerConfiguration = b . findOrCreateChild ( compilerPlugin , "configuration" ) ; b . findOrCreateChild ( compilerConfiguration , "source" ) . setText ( "1.6" ) ; b . findOrCreateChild ( compilerConfiguration , "target" ) . setText ( "1.6" ) ; Element eclipsePlugin = b . checkPlugin ( pluginManagementPlugins , null , "maven-eclipse-plugin" , "2.9" ) ; Element eclipseConfiguration = b . findOrCreateChild ( eclipsePlugin , "configuration" ) ; b . findOrCreateChild ( eclipseConfiguration , "downloadSources" ) . setText ( "true" ) ; b . findOrCreateChild ( eclipseConfiguration , "ajdtVersion" ) . setText ( "none" ) ; Element additionalConfig = b . findOrCreateChild ( eclipseConfiguration , "additionalConfig" ) ; Element file = b . findOrCreateChild ( additionalConfig , "file" ) ; b . findOrCreateChild ( file , "name" ) . setText ( ".settings//org.eclipse.jdt.core.prefs" ) ; Element contentElement = b . findOrCreateChild ( file , "content" ) ; if ( contentElement . getChildren ( ) . isEmpty ( ) ) { contentElement . addContent ( new CDATA ( ( "org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r\n" + ( ( "eclipse.preferences.version=1\r\n" + "org.eclipse.jdt.core.compiler.source=1.6\r\n" ) + "org.eclipse.jdt.core.compiler.compliance=1.6\r\n" ) ) ) ) ; } } Element plugins = b . findOrCreateChild ( build , "plugins" ) ; <START_BUG> Element codegenPlugin = b . checkPlugin ( plugins , "org.unidal.maven.plugins" , "codegen-maven-plugin" , "2.1.1" ) ; <END_BUG> Element codegenPlexus = b . checkPluginExecution ( codegenPlugin , "plexus" , "process-classes" , "generate<seq2seq4repair_space>plexus<seq2seq4repair_space>component<seq2seq4repair_space>descriptor" ) ; Element codegenPlexusConfiguration = b . findOrCreateChild ( codegenPlexus , "configuration" ) ; b . findOrCreateChild ( codegenPlexusConfiguration , "className" ) . setText ( ( ( wizard . getPackage ( ) ) + ".build.ComponentsConfigurator" ) ) ; Element properties = b . findOrCreateChild ( root , "properties" ) ; Element sourceEncoding = b . findOrCreateChild ( properties , "project.build.sourceEncoding" ) ; if ( ( sourceEncoding . getText ( ) . length ( ) ) == 0 ) { sourceEncoding . setText ( "utf-8" ) ; } if ( b . isModified ( ) ) { saveXml ( doc , pomFile ) ; getLog ( ) . info ( String . format ( "Added<seq2seq4repair_space>dependencies<seq2seq4repair_space>to<seq2seq4repair_space>POM<seq2seq4repair_space>file(%s)." , pomFile ) ) ; getLog ( ) . info ( "You<seq2seq4repair_space>need<seq2seq4repair_space>run<seq2seq4repair_space>following<seq2seq4repair_space>command<seq2seq4repair_space>to<seq2seq4repair_space>setup<seq2seq4repair_space>eclipse<seq2seq4repair_space>environment:" ) ; getLog ( ) . info ( "<seq2seq4repair_space>mvn<seq2seq4repair_space>eclipse:clean<seq2seq4repair_space>eclipse:eclipse" ) ; } } protected void saveXml ( Document doc , File file ) throws IOException { } }

Fix:
Element codegenPlugin = b . checkPlugin ( plugins , "org.unidal.maven.plugins" , "plexus-maven-plugin" , "2.1.1" ) ;