Program: 126235
Project: 126235
Buggy source:
/** 
 * Clean the pom_xxx.xml and assembly_xxx.xml and target folder, also clean the module and dependencies.
 */
public void cleanMavenFiles(IProgressMonitor monitor) throws Exception {
  final String routinesPomFileName=PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID);
  File[] pomFiles=codeProject.getProject().getLocation().toFile().listFiles(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.startsWith(TalendMavenConstants.POM_NAME + '_') && name.endsWith(TalendMavenConstants.XML_EXT) && !name.equals(routinesPomFileName);
    }
  }
);
  deleteFiles(pomFiles);
  IFolder assembliesFolder=codeProject.getAssembliesFolder();
  if (assembliesFolder != null && assembliesFolder.exists()) {
    File[] assembliesFiles=assembliesFolder.getLocation().toFile().listFiles(new FilenameFilter(){
      @Override public boolean accept(      File dir,      String name){
        return name.startsWith(TalendMavenConstants.ASSEMBLY_NAME + '_') && name.endsWith(TalendMavenConstants.XML_EXT);
      }
    }
);
    deleteFiles(assembliesFiles);
  }
  FilesUtils.deleteFile(codeProject.getOutputFolder().getParent().getLocation().toFile(),true);
  syncRoutinesPom(false);
  IFile projectPomFile=codeProject.getProjectPom();
  File pPomFile=projectPomFile.getLocation().toFile();
  if (pPomFile.exists()) {
    MavenModelManager mavenModelManager=MavenPlugin.getMavenModelManager();
    Model projModel=mavenModelManager.readMavenModel(projectPomFile);
    List<String> modules=projModel.getModules();
    if (modules != null) {
      modules.clear();
    }
    IFile routinesPomFile=codeProject.getProject().getFile(PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID));
    Model routinesModel=PomUtil.getRoutinesTempalteModel();
    if (routinesPomFile.exists()) {
      routinesModel=mavenModelManager.readMavenModel(routinesPomFile);
    }
    modules.add(routinesPomFile.getName());
    List<Dependency> routinesDependencies=routinesModel.getDependencies();
    ProcessorDependenciesManager.updateDependencies(null,projModel,routinesDependencies,true);
    PomUtil.savePom(monitor,projModel,projectPomFile);
    PomUtil.installDependencies(routinesDependencies);
  }
  codeProject.buildModules(TalendMavenConstants.GOAL_COMPILE,null);
}

Fixed version (ground truth):
/** 
 * Clean the pom_xxx.xml and assembly_xxx.xml and target folder, also clean the module and dependencies.
 */
public void cleanMavenFiles(IProgressMonitor monitor) throws Exception {
  final String routinesPomFileName=PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID);
  File[] pomFiles=codeProject.getProject().getLocation().toFile().listFiles(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.startsWith(TalendMavenConstants.POM_NAME + '_') && name.endsWith(TalendMavenConstants.XML_EXT) && !name.equals(routinesPomFileName);
    }
  }
);
  deleteFiles(pomFiles);
  IFolder assembliesFolder=codeProject.getAssembliesFolder();
  if (assembliesFolder != null && assembliesFolder.exists()) {
    File[] assembliesFiles=assembliesFolder.getLocation().toFile().listFiles(new FilenameFilter(){
      @Override public boolean accept(      File dir,      String name){
        return name.startsWith(TalendMavenConstants.ASSEMBLY_NAME + '_') && name.endsWith(TalendMavenConstants.XML_EXT);
      }
    }
);
    deleteFiles(assembliesFiles);
  }
  FilesUtils.deleteFile(codeProject.getOutputFolder().getParent().getLocation().toFile(),true);
  syncRoutinesPom(false);
  IFile projectPomFile=codeProject.getProjectPom();
  File pPomFile=projectPomFile.getLocation().toFile();
  if (pPomFile.exists()) {
    MavenModelManager mavenModelManager=MavenPlugin.getMavenModelManager();
    Model projModel=mavenModelManager.readMavenModel(projectPomFile);
    List<String> modules=projModel.getModules();
    if (modules != null) {
      modules.clear();
    }
    IFile routinesPomFile=codeProject.getProject().getFile(PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID));
    Model routinesModel=PomUtil.getRoutinesTempalteModel();
    if (routinesPomFile.exists()) {
      routinesModel=mavenModelManager.readMavenModel(routinesPomFile);
    }
    modules.add(routinesPomFile.getName());
    List<Dependency> routinesDependencies=routinesModel.getDependencies();
    ProcessorDependenciesManager.updateDependencies(null,projModel,routinesDependencies,true);
    PomUtil.savePom(monitor,projModel,projectPomFile);
    PomUtil.installDependencies(routinesDependencies);
  }
  codeProject.buildModules(TalendMavenConstants.GOAL_COMPILE,null,monitor);
}