Source:
public void execute() throws MojoExecutionException { baseFolder = StringUtils.defaultIfEmpty(baseFolder, "GUIData"); Logger.setLogger(getLog()); Log logger = Logger.getLogger(); if (logger.isDebugEnabled()) { displayProjectInformation(); } String sourceDir = sourceDir(); String generatedSourceDir = generatedSourcesDir(); String resourceDir = resourcesDir() + File.separator + baseFolder; List<File> allDataFiles = loadFiles(new File(resourceDir)); createSeLionPageDetailsFile(allDataFiles); CodeGenerator helper = new CodeGenerator(generatedSourceDir); for (File dataFile : allDataFiles) { try { String folder = pathToFolder(dataFile); String domain = folder.replace(File.separator, "/"); folder = folder.replace(File.separator, "."); if (excludeDomains.contains(domain)) { logger.info("Excluded code generation for YAML file [" + dataFile.getName() + "] as the corresponding domain [" + domain + "] is available in excludeDomains list"); continue; } String relativePath = relativePath(folder); File extendedFile = extendedFileLoc(sourceDir, relativePath, dataFile); File baseFile = baseFileLoc(generatedSourceDir, relativePath, dataFile); if (generateJavaCode(baseFile, dataFile, extendedFile)) { logger.info("Generating java file for YAML file [" + dataFile.getName() + "] in domain [" + domain + "]"); String tempPackage = ""; if (!basePackage.isEmpty()) { tempPackage += basePackage; } if (!folder.isEmpty()) { tempPackage += tempPackage.isEmpty() ? folder : "." + folder; } helper.generateNewCode(dataFile, relativePath, tempPackage, domain); } } catch (Exception e) { String errorMsg = " \n SeLion code generator failed when generating code for " + dataFile.getAbsolutePath() + "\n" + "Root Cause : \n" + e.toString(); throw new MojoExecutionException(errorMsg, e); } } }

Target:
public void execute() throws MojoExecutionException { baseFolder = StringUtils.defaultIfEmpty(baseFolder, "GUIData"); Logger.setLogger(getLog()); Log logger = Logger.getLogger(); if (logger.isDebugEnabled()) { displayProjectInformation(); } String sourceDir = sourceDir(); String generatedSourceDir = generatedSourcesDir(); String resourceDir = resourcesDir() + File.separator + baseFolder; List<File> allDataFiles = loadFiles(new File(resourceDir)); createSeLionPageDetailsFile(allDataFiles); CodeGenerator helper = new CodeGenerator(generatedSourceDir); for (File dataFile : allDataFiles) { try { String folder = pathToFolder(dataFile); String domain = folder.replace(File.separator, "/"); folder = folder.replace(File.separator, "."); if (excludeDomains.contains(domain)) { logger.info("Excluded code generation for YAML file [" + dataFile.getName() + "] as the corresponding domain [" + domain + "] is available in excludeDomains list"); continue; } String relativePath = relativePath(folder); File extendedFile = extendedFileLoc(sourceDir, relativePath, dataFile); File baseFile = baseFileLoc(generatedSourceDir, relativePath, dataFile); if (generateJavaCode(baseFile, dataFile, extendedFile)) { logger.info("Generating java file for YAML file [" + dataFile.getName() + "] in domain [" + domain + "]"); String tempPackage = basePackage; if (!folder.isEmpty()) { tempPackage += tempPackage.isEmpty() ? folder : "." + folder; } helper.generateNewCode(dataFile, relativePath, tempPackage, domain); } } catch (Exception e) { String errorMsg = " \n SeLion code generator failed when generating code for " + dataFile.getAbsolutePath() + "\n" + "Root Cause : \n" + e.toString(); throw new MojoExecutionException(errorMsg, e); } } }