/* (non-Javadoc)
@see org.apache.maven.plugin.Mojo#execute()
355737
@Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        final Log log = this.getLog();

        try {
            final ResourcesAggregator aggr = this.createResourcesAggregator();
            
            final Set<String> skinConfigurationFiles = this.findSkinConfigurationFiles();
            for (final String fileName : skinConfigurationFiles) {
                log.info("Aggregating: " + fileName);
                final File skinConfigurationFile = new File(this.skinSourceDirectory, fileName);
                final File skinOutputDirectory = new File(this.baseOutputDirectory, fileName).getParentFile();
                this.doAggregation(aggr, skinConfigurationFile, skinOutputDirectory);
            }
            
        } catch (AggregationException e) {
            throw new MojoExecutionException("aggregation failed", e);
        } catch (IOException e) {
            throw new MojoExecutionException("IOException occurred", e);
        }
    }
1244798
public void execute() throws MojoExecutionException {
        super.execute();
        try {
            lambdaFunctions.forEach(context -> {
                try {
                    deleteTriggers.andThen(deleteFunction).apply(
                            context.withFunctionArn(lambdaClient.getFunction(new GetFunctionRequest()
                                .withFunctionName(context.getFunctionName())).getConfiguration().getFunctionArn()));                      
                } catch (Exception e) {
                    getLog().error(e.getMessage());
                }
            });
        } catch (Exception e) {
            getLog().error(e.getMessage(), e);
        }
    }
572720
public void execute() throws MojoExecutionException
    {
        if (properties == null)
        {
            getLog().warn("run-script failed: No properties supplied");
            return;
        }
        boolean bSuccess = false;
        Environment env = null;
        RunScriptProcess process = null;
        try {
            env = new Environment(properties);
            Application app = new ThinApplication(env, properties, null);
            Task task = new AutoTask(app, null, null);
            process = new RunScriptProcess(task, null, null);
            bSuccess = (process.doRunCommand(null, properties) == DBConstants.NORMAL_RETURN);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (process != null)
                process.free();
            if (env != null)
                env.free();
        }
        if (bSuccess)
            getLog().info("run-script ran successfully: " + properties.get(DBParams.PROCESS));
        else
            getLog().warn("run-script failed: " + properties.get(DBParams.PROCESS));
    }
164933
public void execute() throws MojoExecutionException {

        // 1. Create and set up directories
        getLog().info("Creating and setting up the bundle directories");
        buildDirectory.mkdirs();

        File bundleDir = new File(buildDirectory, bundleName + ".app");
        bundleDir.mkdirs();

        File contentsDir = new File(bundleDir, "Contents");
        contentsDir.mkdirs();

        File resourcesDir = new File(contentsDir, "Resources");
        resourcesDir.mkdirs();

        File javaDirectory = new File(contentsDir, "Java");
        javaDirectory.mkdirs();

        File macOSDirectory = new File(contentsDir, "MacOS");
        macOSDirectory.mkdirs();

        // 2. Copy in the native java application stub
        getLog().info("Copying the native Java Application Stub");
        File launcher = new File(macOSDirectory, javaLauncherName);
        launcher.setExecutable(true);

        FileOutputStream launcherStream = null;
        try {
            launcherStream = new FileOutputStream(launcher);
        } catch (FileNotFoundException ex) {
            throw new MojoExecutionException("Could not copy file to directory " + launcher, ex);
        }

        InputStream launcherResourceStream = this.getClass().getResourceAsStream(javaLauncherName);
        try {
            IOUtil.copy(launcherResourceStream, launcherStream);
        } catch (IOException ex) {
            throw new MojoExecutionException("Could not copy file " + javaLauncherName + " to directory " + macOSDirectory, ex);
        }

        // 3.Copy icon file to the bundle if specified
        if (iconFile != null) {
            File f = searchFile(iconFile, project.getBasedir());

            if (f != null && f.exists() && f.isFile()) {
                getLog().info("Copying the Icon File");
                try {
                    FileUtils.copyFileToDirectory(f, resourcesDir);
                } catch (IOException ex) {
                    throw new MojoExecutionException("Error copying file " + iconFile + " to " + resourcesDir, ex);
                }
            } else {
                throw new MojoExecutionException(String.format("Could not locate iconFile '%s'", iconFile));
            }
        }

        // 4. Resolve and copy in all dependencies from the pom
        getLog().info("Copying dependencies");
        List<String> files = copyDependencies(javaDirectory);
        if (additionalBundledClasspathResources != null && !additionalBundledClasspathResources.isEmpty()) {
            files.addAll(copyAdditionalBundledClasspathResources(javaDirectory, "lib", additionalBundledClasspathResources));
        }

        // 5. Check if JRE should be embedded. Check JRE path. Copy JRE
        if (jrePath != null) {
            File f = new File(jrePath);
            if (f.exists() && f.isDirectory()) {
                // Check if the source folder is a jdk-home
                File pluginsDirectory = new File(contentsDir, "PlugIns/JRE/Contents/Home/jre");
                pluginsDirectory.mkdirs();

                File sourceFolder = new File(jrePath, "Contents/Home");
                if (new File(jrePath, "Contents/Home/jre").exists()) {
                    sourceFolder = new File(jrePath, "Contents/Home/jre");
                }

                try {
                    getLog().info("Copying the JRE Folder from : [" + sourceFolder + "] to PlugIn folder: [" + pluginsDirectory + "]");
                    FileUtils.copyDirectoryStructure(sourceFolder, pluginsDirectory);
                    File binFolder = new File(pluginsDirectory, "bin");
                    //Setting execute permissions on executables in JRE
                    for (String filename : binFolder.list()) {
                        new File(binFolder, filename).setExecutable(true, false);
                    }

                    new File (pluginsDirectory, "lib/jspawnhelper").setExecutable(true,false);
                    embeddJre = true;
                } catch (IOException ex) {
                    throw new MojoExecutionException("Error copying folder " + f + " to " + pluginsDirectory, ex);
                }
            } else {
                getLog().warn("JRE not found check jrePath setting in pom.xml");
            }
        } else if (jreFullPath != null){
            getLog().info("JRE Full path is used [" + jreFullPath + "]");
            embeddJre = true;
        }

        // 6. Create and write the Info.plist file
        getLog().info("Writing the Info.plist file");
        File infoPlist = new File(bundleDir, "Contents" + File.separator + "Info.plist");
        this.writeInfoPlist(infoPlist, files);

        // 7. Copy specified additional resources into the top level directory
        getLog().info("Copying additional resources");
        if (additionalResources != null && !additionalResources.isEmpty()) {
            this.copyResources(buildDirectory, additionalResources);
        }

        // 7. Make the stub executable
        if (!SystemUtils.IS_OS_WINDOWS) {
            getLog().info("Making stub executable");
            Commandline chmod = new Commandline();
            try {
                chmod.setExecutable("chmod");
                chmod.createArgument().setValue("755");
                chmod.createArgument().setValue(launcher.getAbsolutePath());

                chmod.execute();
            } catch (CommandLineException e) {
                throw new MojoExecutionException("Error executing " + chmod + " ", e);
            }
        } else {
            getLog().warn("The stub was created without executable file permissions for UNIX systems");
        }

        // 8. Create the DMG file
        if (generateDiskImageFile) {
            if (SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC) {
                getLog().info("Generating the Disk Image file");
                Commandline dmg = new Commandline();
                try {
                    // user wants /Applications symlink in the resulting disk image
                    if (includeApplicationsSymlink) {
                        createApplicationsSymlink();
                    }
                    dmg.setExecutable("hdiutil");
                    dmg.createArgument().setValue("create");
                    dmg.createArgument().setValue("-srcfolder");
                    dmg.createArgument().setValue(buildDirectory.getAbsolutePath());
                    dmg.createArgument().setValue(diskImageFile.getAbsolutePath());

                    try {
                        dmg.execute().waitFor();
                    } catch (InterruptedException ex) {
                        throw new MojoExecutionException("Thread was interrupted while creating DMG " + diskImageFile, ex);
                    } finally {
                        if (includeApplicationsSymlink) {
                            removeApplicationsSymlink();
                        }
                    }
                } catch (CommandLineException ex) {
                    throw new MojoExecutionException("Error creating disk image " + diskImageFile, ex);
                }

                if (diskImageInternetEnable) {
                    getLog().info("Enabling the Disk Image file for internet");
                    try {
                        Commandline internetEnableCommand = new Commandline();

                        internetEnableCommand.setExecutable("hdiutil");
                        internetEnableCommand.createArgument().setValue("internet-enable");
                        internetEnableCommand.createArgument().setValue("-yes");
                        internetEnableCommand.createArgument().setValue(diskImageFile.getAbsolutePath());

                        internetEnableCommand.execute();
                    } catch (CommandLineException ex) {
                        throw new MojoExecutionException("Error internet enabling disk image: " + diskImageFile, ex);
                    }
                }
                projectHelper.attachArtifact(project, "dmg", null, diskImageFile);
            }
            if (SystemUtils.IS_OS_LINUX) {
                getLog().info("Generating the Disk Image file");
                Commandline linux_dmg = new Commandline();
                try {
                    linux_dmg.setExecutable("genisoimage");
                    linux_dmg.createArgument().setValue("-V");
                    linux_dmg.createArgument().setValue(bundleName);
                    linux_dmg.createArgument().setValue("-D");
                    linux_dmg.createArgument().setValue("-R");
                    linux_dmg.createArgument().setValue("-apple");
                    linux_dmg.createArgument().setValue("-no-pad");
                    linux_dmg.createArgument().setValue("-o");
                    linux_dmg.createArgument().setValue(diskImageFile.getAbsolutePath());
                    linux_dmg.createArgument().setValue(buildDirectory.getAbsolutePath());

                    try {
                        linux_dmg.execute().waitFor();
                    } catch (InterruptedException ex) {
                        throw new MojoExecutionException("Thread was interrupted while creating DMG " + diskImageFile,
                                ex);
                    }
                } catch (CommandLineException ex) {
                    throw new MojoExecutionException("Error creating disk image " + diskImageFile + " genisoimage probably missing", ex);
                }
                projectHelper.attachArtifact(project, "dmg", null, diskImageFile);

            } else {
                getLog().warn("Disk Image file cannot be generated in non Mac OS X and Linux environments");
            }
        }

        getLog().info("App Bundle generation finished");
    }
304349
public void execute() throws MojoExecutionException, MojoFailureException {
        boolean usingSpringJavaConfigureMain = false;
        boolean useCdiMain = useCDI || detectCDIOnClassPath();
        boolean usingBlueprintMain = useBlueprint || detectBlueprintOnClassPathOrBlueprintXMLFiles();
        if (killAfter != -1) {
            getLog().warn("Warning: killAfter is now deprecated. Do you need it ? Please comment on MEXEC-6.");
        }

        // lets create the command line arguments to pass in...
        List<String> args = new ArrayList<String>();
        if (trace) {
            args.add("-t");
        }

        if (applicationContextUri != null) {
            args.add("-ac");
            args.add(applicationContextUri);
        } else if (fileApplicationContextUri != null) {
            args.add("-fa");
            args.add(fileApplicationContextUri);
        }

        if (configClasses != null) {
            args.add("-cc");
            args.add(configClasses);
            usingSpringJavaConfigureMain = true;
        }
        if (basedPackages != null) {
            args.add("-bp");
            args.add(basedPackages);
            usingSpringJavaConfigureMain = true;
        }

        args.add("-d");
        args.add(duration);
        if (arguments != null) {
            args.addAll(Arrays.asList(arguments));
        }

        if (usingSpringJavaConfigureMain) {
            mainClass = "org.apache.camel.spring.javaconfig.Main";
            getLog().info("Using org.apache.camel.spring.javaconfig.Main to initiate a CamelContext");
        } else if (useCdiMain) {
            mainClass = "org.apache.camel.cdi.Main";
            // must include plugin dependencies for cdi
            extraPluginDependencyArtifactId = "camel-cdi";
            getLog().info("Using " + mainClass + " to initiate a CamelContext");
        } else if (usingBlueprintMain) {
            mainClass = "org.apache.camel.test.blueprint.Main";
            // must include plugin dependencies for blueprint
            extraPluginDependencyArtifactId = "camel-test-blueprint";
            // set the configAdmin pid
            if (configAdminPid != null) {
                args.add("-pid");
                args.add(configAdminPid);
            }
            // set the configAdmin pFile
            if (configAdminFileName != null) {
                args.add("-pf");
                args.add(configAdminFileName);
            }
            getLog().info("Using org.apache.camel.test.blueprint.Main to initiate a CamelContext");
        } else if (mainClass != null) {
            getLog().info("Using custom " + mainClass + " to initiate a CamelContext");
        } else {
            // use spring by default
            getLog().info("Using org.apache.camel.spring.Main to initiate a CamelContext");
            mainClass = "org.apache.camel.spring.Main";
        }

        arguments = new String[args.size()];
        args.toArray(arguments);

        if (getLog().isDebugEnabled()) {
            StringBuilder msg = new StringBuilder("Invoking: ");
            msg.append(mainClass);
            msg.append(".main(");
            for (int i = 0; i < arguments.length; i++) {
                if (i > 0) {
                    msg.append(", ");
                }
                msg.append(arguments[i]);
            }
            msg.append(")");
            getLog().debug(msg);
        }

        IsolatedThreadGroup threadGroup = new IsolatedThreadGroup(mainClass /* name */);
        final Thread bootstrapThread = new Thread(threadGroup, new Runnable() {
            public void run() {
                try {
                    beforeBootstrapCamel();

                    getLog().info("Starting Camel ...");
                    Method main = Thread.currentThread().getContextClassLoader()
                        .loadClass(mainClass).getMethod("main", String[].class);
                    main.invoke(null, new Object[]{arguments});

                    afterBootstrapCamel();
                } catch (Exception e) { // just pass it on
                    // let it be printed so end users can see the exception on the console
                    getLog().error("*************************************");
                    getLog().error("Error occurred while running main from: " + mainClass);
                    getLog().error(e);
                    getLog().error("*************************************");
                    Thread.currentThread().getThreadGroup().uncaughtException(Thread.currentThread(), e);
                }
            }
        }, mainClass + ".main()");

        bootstrapThread.setContextClassLoader(getClassLoader());
        setSystemProperties();

        bootstrapThread.start();
        joinNonDaemonThreads(threadGroup);
        // It's plausible that spontaneously a non-daemon thread might be
        // created as we try and shut down,
        // but it's too late since the termination condition (only daemon
        // threads) has been triggered.
        if (keepAlive) {
            getLog().warn("Warning: keepAlive is now deprecated and obsolete. Do you need it? Please comment on MEXEC-6.");
            waitFor(0);
        }

        if (cleanupDaemonThreads) {

            terminateThreads(threadGroup);

            try {
                threadGroup.destroy();
            } catch (IllegalThreadStateException e) {
                getLog().warn("Couldn't destroy threadgroup " + threadGroup, e);
            }
        }

        if (originalSystemProperties != null) {
            System.setProperties(originalSystemProperties);
        }

        synchronized (threadGroup) {
            if (threadGroup.uncaughtException != null) {
                throw new MojoExecutionException(null, threadGroup.uncaughtException);
            }
        }

        registerSourceRoots();
    }
202374
@Override
    public void execute() {
        if ((str == null || str.isEmpty()) && !FindContext.isAvailable()) {
            try {
                str = editor.readLine("Find previous:");
                editor.findPrevious(str);
                FindContext.setLastSearch(str);
            } catch (IOException e) {
                //noop
            }
        } else if (FindContext.isAvailable()) {
            editor.findPrevious(FindContext.getLastSearch());
        } else {
            editor.findPrevious(str);
            FindContext.setLastSearch(str);
        }
    }
1005420
public void execute() throws MojoExecutionException, MojoFailureException {
        if(preverifyPath == null) {
            getLog().debug("skip native preverification");
            return;
        }
        
        getLog().debug("start native preverification");

        final File preverifyCmd= getAbsolutePreverifyCommand();
        
        StreamConsumer stdoutLogger= new LogWriter(false);
        StreamConsumer stderrLogger= new LogWriter(true);
        
        String classPath = getClassPath(getProject());
        AbstractConfiguration[] configurations= (AbstractConfiguration[]) getPluginContext().get(ConfiguratorMojo.GENERATED_CONFIGURATIONS_KEY);
        
        for(AbstractConfiguration configuration : configurations) {
            if(!(configuration instanceof NodeConfiguration)) {
                continue;
            }
            
            String classifier= configuration.className.substring(configuration.className.lastIndexOf('.') + 1);
            File oldJar= checkJarFile(classifier);
            
            if(keepJars) {
                try {
                    FileUtils.copyFile(oldJar, getJarFile(classifier + "-before_preverify"));
                } catch (IOException ioe) {
                    getLog().warn("could not keep old jar '" + oldJar.getAbsolutePath() + "'", ioe);
                }
            }
            
            getLog().info("Preverifying jar: " + FileNameUtil.getAbsolutPath(oldJar));
            
            Commandline commandLine= new Commandline(preverifyCmd.getPath() + " -classpath " + classPath + " -d " + FileNameUtil.getAbsolutPath(oldJar.getParentFile()) + " " + FileNameUtil.getAbsolutPath(oldJar));
            getLog().debug(commandLine.toString());
            
            try {
                if(CommandLineUtils.executeCommandLine(commandLine, stdoutLogger, stderrLogger) != 0) {
                    throw new MojoExecutionException("Preverification failed. Please read the log for details.");
                }
            } catch (CommandLineException cle) {
                throw new MojoExecutionException("could not execute preverify command", cle);
            }
        }

        getLog().debug("finished preverification");
    }
107759
public void execute() throws MojoExecutionException, MojoFailureException {
        Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, this);
        vc.put("helper", this);
        vc.put("ESC", "$");

        if (null != sourceVersion) {
            getLog().info("sourceVersion=" + sourceVersion);
            vc.put("sourceVersion", sourceVersion);
        }

        Map<String, String> mySqlTypes = new HashMap<String, String>();
        Map<String, String> sqLiteTypes = new HashMap<String, String>();
        Map<String, String> mySqlDefaults = new HashMap<String, String>();
        // for MySQL
        mySqlTypes.put(Long.class.getName(), "BIGINT");
        mySqlTypes.put(Integer.class.getName(), "INTEGER");
        mySqlTypes.put(Short.class.getName(), "SMALLINT");
        mySqlTypes.put(Byte.class.getName(), "TINYINT");
        mySqlTypes.put(Double.class.getName(), "DOUBLE PRECISION");
        // MySQL max key length is 767:
        mySqlTypes.put(String.class.getName(), "VARCHAR(255)");
        mySqlTypes.put(Boolean.class.getName(), "BIT(1)");
        mySqlTypes.put(java.util.Date.class.getName(), "TIMESTAMP");

        mySqlDefaults.put(Long.class.getName(), "DEFAULT NULL");
        mySqlDefaults.put(Integer.class.getName(), "DEFAULT NULL");
        mySqlDefaults.put(Short.class.getName(), "DEFAULT NULL");
        mySqlDefaults.put(Byte.class.getName(), "DEFAULT NULL");
        mySqlDefaults.put(Double.class.getName(), "DEFAULT NULL");
        mySqlDefaults.put(String.class.getName(), "DEFAULT NULL");
        mySqlDefaults.put(Boolean.class.getName(), "DEFAULT NULL");
        mySqlDefaults.put(java.util.Date.class.getName(), "NOT NULL DEFAULT CURRENT_TIMESTAMP");
        
        // for SQLite
        sqLiteTypes.put(Long.class.getName(), "INT");
        sqLiteTypes.put(String.class.getName(), "TEXT");
        sqLiteTypes.put(Boolean.class.getName(), "TINYINT");
        sqLiteTypes.put(Float.class.getName(), "REAL");
        sqLiteTypes.put(Double.class.getName(), "REAL");

        if ("Android".equals(persistenceType)) {
            vc.put("dbTypes", sqLiteTypes);
        }
        else {
            // FIXME: other DB types
            vc.put("dbTypes", mySqlTypes);
            vc.put("dbDefaults", mySqlDefaults);
        }

        Date current = new Date();
        vc.put("currentDate", DATEFORMAT.format(current));
        vc.put("persistenceUnitName", persistenceUnitName);
        vc.put("containerManagedEntityManager", containerManagedEntityManager);
        vc.put("containerManagedTransactionManager", containerManagedTransactionManager);

        // persistence type and merge scheme:
        vc.put("persistenceType", persistenceType);
        ApplicationContext springCtx = new GenericXmlApplicationContext("/META-INF/merge-scheme-beans.xml");
        mergeScheme = (MergeScheme) springCtx.getBean("mergeScheme" + persistenceType);

        getLog().debug("templateFolder=" + templateFolder);
        final Properties p = new Properties();
        p.setProperty("class.resource.loader.description", "Velocity Classpath Resource Loader");
        p.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");

        // load templates from external folder?
        if (null == templateFolder) {
            p.setProperty("resource.loader", "class");
        }
        else {
            p.setProperty("resource.loader", "file, class");
            p.setProperty("file.resource.loader.description", "Velocity File Resource Loader");
            p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
            p.setProperty("file.resource.loader.path", templateFolder);
            p.setProperty("file.resource.loader.cache", "true");
            p.setProperty("file.resource.loader.modificationCheckInterval", "0");
        }
        try {
            Velocity.init(p);
        }
        catch (Exception e) {
            throw new MojoExecutionException(getClass().getSimpleName(), e);
        }

        daoBasePackage = basePackage + "." + daoPackageName;
        domainBasePackage = basePackage + "." + domainPackageName;
        controllerBasePackage = basePackage + "." + controllerPackageName;

        vc.put("basePackage", basePackage);
        vc.put("daoBasePackage", daoBasePackage);
        vc.put("domainBasePackage", domainBasePackage);
        vc.put("controllerBasePackage", controllerBasePackage);

        mkdirs();
    }
279030
public final void execute() throws MojoExecutionException,
			MojoFailureException {

		// If skip flag set then omit image generation
		if (isSkip()) {
			getLog().info("Skipping creation of image files");
		} else {

			// Run the dot command only if dot files have been changed
			Set<String> changedDotFiles = getChangedDotFiles();
			if (changedDotFiles != null && !changedDotFiles.isEmpty()) {
				if (!executeDot(changedDotFiles)) {
					throw new MojoExecutionException("Executing '" + command
							+ "' command failed");
				}
			}
		}
	}
837316
@Override
    public void execute()
    {
        if ( "pom".equals( project.getPackaging() ) )
        {
            return;
        }

        if ( skip )
        {
            return;
        }
        
        long ts = System.currentTimeMillis();

        Properties projectProperties = project.getProperties();

        restoreProperty( projectProperties, "sbt._scalacOptions" );
        restoreProperty( projectProperties, "sbt._scalacPlugins" );
        restoreProperty( projectProperties, "addScalacArgs" );
        restoreProperty( projectProperties, "analysisCacheFile" );
        restoreProperty( projectProperties, "maven.test.failure.ignore" );

        long te = System.currentTimeMillis();
        getLog().debug( String.format( "Mojo execution time: %d ms", te - ts ) );
    }
475579
public void execute() throws MojoExecutionException {
		synchronized (lock) {
			injectDependencyDefaults();
			resolveArtifacts();

			// Install project dependencies into classloader's class path
			// and execute xjc2.
			final ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
			final ClassLoader classLoader = createClassLoader(currentClassLoader);
			Thread.currentThread().setContextClassLoader(classLoader);
			final Locale currentDefaultLocale = Locale.getDefault();
			try {
				final Locale locale = LocaleUtils.valueOf(getLocale());
				Locale.setDefault(locale);
				//
				doExecute();

			} finally {
				Locale.setDefault(currentDefaultLocale);
				// Set back the old classloader
				Thread.currentThread().setContextClassLoader(currentClassLoader);
			}
		}
	}
915811
@Override
    public void execute() throws MojoExecutionException {
        
        if (StringUtils.isEmpty(moduleSource) && ignoreMissingSource) {
            getLog().info("No help module source specified.");
            return;
        }
        
        init("help", moduleBase);
        registerLoader(new SourceLoader("javahelp", "*.hs", ZipIterator.class));
        registerLoader(new SourceLoader("ohj", "*.hs", ZipIterator.class));
        registerLoader(new ChmSourceLoader());
        registerExternalLoaders();
        SourceLoader loader = sourceLoaders.get(moduleFormat);
        
        if (loader == null) {
            throw new MojoExecutionException("No source loader found for format " + moduleFormat);
        }
        
        try {
            String sourceFilename = FileUtils.normalize(baseDirectory + "/" + moduleSource);
            HelpProcessor processor = new HelpProcessor(this, sourceFilename, loader);
            processor.transform();
            addConfigEntry("help", moduleId, processor.getHelpSetFile(), moduleName, getModuleVersion(), moduleFormat,
                moduleLocale);
            assembleArchive();
        } catch (Exception e) {
            throw new MojoExecutionException("Unexpected error.", e);
        }
    }
623085
protected synchronized void executeMojo(File targetDir) throws MojoExecutionException {
		if (this.generateTargets.contains(targetDir)
				&& targetDir.isDirectory()) {
			getLog().debug("Skiping " + targetDir + " because is was already generated"); //$NON-NLS-1$ //$NON-NLS-2$
			return;
		}

		this.generateTargets.add(targetDir);

		final File[] sourceDirs;
		final File mainDirectory = new File(getSourceDirectory(), "main"); //$NON-NLS-1$
		if (this.sources == null || this.sources.length == 0) {
			sourceDirs = new File[] {
				new File(mainDirectory, "java"), //$NON-NLS-1$
			};
		} else {
			sourceDirs = this.sources;
		}

		clearInternalBuffers();

		for (final File sourceDir : sourceDirs) {
			Map<File, File> htmlBasedFiles = this.bufferedFiles.get(sourceDir);

			if (htmlBasedFiles == null) {
				htmlBasedFiles = new TreeMap<>();
				if (sourceDir.isDirectory()) {
					// Search for .java files
					findFiles(sourceDir, new JavaSourceFileFilter(), htmlBasedFiles);
				}

				this.bufferedFiles.put(sourceDir, htmlBasedFiles);
			}

			for (final Entry<File, File> entry : htmlBasedFiles.entrySet()) {
				final String baseFile = removePathPrefix(entry.getValue(), entry.getKey());
				replaceInFileBuffered(
						entry.getKey(),
						new File(targetDir, baseFile),
						ReplacementType.HTML,
						sourceDirs,
						false);
			}
		}
	}
131516
public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        if ( isSkip() )
        {
            getLog().info( "skipping execute as per configuraion" );
            return;
        }
        if ( killAfter != -1 )
        {
            getLog().warn( "Warning: killAfter is now deprecated. Do you need it ? Please comment on MEXEC-6." );
        }

        arguments = new String[] {outputParentDirectory.getAbsolutePath(), outputDirectory.getAbsolutePath(), filterClassPackage};

        if ( getLog().isDebugEnabled() )
        {
            StringBuffer msg = new StringBuffer( "Invoking : " );
            msg.append( mainClass );
            msg.append( ".main(" );
            for ( int i = 0; i < arguments.length; i++ )
            {
                if ( i > 0 )
                {
                    msg.append( ", " );
                }
                msg.append( arguments[i] );
            }
            msg.append( ")" );
            getLog().debug( msg );
        }

        final Log log = getLog();
        IsolatedThreadGroup threadGroup = new IsolatedThreadGroup( mainClass /* name */);
        Thread bootstrapThread = new Thread( threadGroup, new Runnable()
        {
            public void run()
            {
            	long current = System.currentTimeMillis();
                try
                {   
                	
                    Method main =
                        Thread.currentThread().getContextClassLoader().loadClass( mainClass ).getMethod( "main",
                                                                                                         new Class[] { String[].class } );
                    if ( !main.isAccessible() )
                    {
                        getLog().debug( "Setting accessibility to true in order to invoke main()." );
                        main.setAccessible( true );
                    }
                    if ( !Modifier.isStatic( main.getModifiers() ) )
                    {
                        throw new MojoExecutionException( "Can't call main(String[])-method because it is not static." );
                    }
                    main.invoke( null, new Object[] { arguments } );
                }
                catch ( NoSuchMethodException e )
                { // just pass it on
                    Thread.currentThread().getThreadGroup().uncaughtException( Thread.currentThread(),
                                                                               new Exception(
                                                                                              "The specified mainClass doesn't contain a main method with appropriate signature.",
                                                                                              e ) );
                }
                catch ( Exception e )
                { // just pass it on
                    Thread.currentThread().getThreadGroup().uncaughtException( Thread.currentThread(), e );
                } finally {
                	log.info("JProtobuf pre compile done time took: " + (System.currentTimeMillis() - current) + "ms");
                }
            }
        }, mainClass + ".main()" );
        bootstrapThread.setContextClassLoader( getClassLoader() );
        setSystemProperties();

        bootstrapThread.start();
        joinNonDaemonThreads( threadGroup );
        // It's plausible that spontaneously a non-daemon thread might be created as we try and shut down,
        // but it's too late since the termination condition (only daemon threads) has been triggered.
        if ( keepAlive )
        {
            getLog().warn( "Warning: keepAlive is now deprecated and obsolete. Do you need it? Please comment on MEXEC-6." );
            waitFor( 0 );
        }

        if ( cleanupDaemonThreads )
        {

            terminateThreads( threadGroup );

            try
            {
                threadGroup.destroy();
            }
            catch ( IllegalThreadStateException e )
            {
                getLog().warn( "Couldn't destroy threadgroup " + threadGroup, e );
            }
        }

        if ( originalSystemProperties != null )
        {
            System.setProperties( originalSystemProperties );
        }

        synchronized ( threadGroup )
        {
            if ( threadGroup.uncaughtException != null )
            {
                throw new MojoExecutionException( "An exception occured while executing the Java class. "
                    + threadGroup.uncaughtException.getMessage(), threadGroup.uncaughtException );
            }
        }

        registerSourceRoots();
    }
193231
@Override
    public void execute() {
        logger = new DITAOTAntLogger(getProject());
        logger.info(message);

        //ensure outdir is absolute
        if (!new File(outputdir).isAbsolute()) {
            outputdir = new File(basedir, outputdir).getAbsolutePath();
        }

        //initialize language map
        createLangMap();
        //initialize entity map
        createEntityMap();
        //Initialize entitye exceptions
        entityExceptionSet = new HashSet<>(128);
        //initialize charset map
        createCharsetMap();
        //change charset of html files
        convertHtmlCharset();
        //update entity and lang code
        updateAllEntitiesAndLangs();
    }
1374130
@Override
    public void execute()
            throws MojoExecutionException
    {
        if ( skip )
        {
            getLog().info( "Skipping JAR unsigning for file: " + jarPath.getAbsolutePath() );
            return;
        }
        if ( jarPath.isDirectory() )
        {
            for ( File jar : jarPath.listFiles() )
            {
                if ( JarSignerUtil.isZipFile( jar ) )
                {
                    signTool.unsign( jar, verbose );
                }
                else
                {
                    getLog().info( "Skipping JAR unsigning for file: " + jar.getAbsolutePath() );
                }
            }
        }
        else
        {
            signTool.unsign( this.jarPath, verbose );
        }
    }
711418
@Override
    public final void execute() throws MojoExecutionException, MojoFailureException {
        if (skipTests) {
            if (session.getGoals().contains("jmeter:gui")) {
                if (!"default-cli".equals(mojoExecution.getExecutionId()) && !"compile".equals(mojoExecution.getLifecyclePhase())) {
                    getLog().info("Performance tests are skipped.");

                    return;
                }
            } else {
                getLog().info("Performance tests are skipped.");

                return;
            }
        }

        if (useMavenProxy && proxyConfig == null) {
            loadMavenProxy();
        }

        doExecute();
    }