/*
(non-Javadoc)
@see org.codehaus.mojo.pluginsupport.MojoSupport#doExecute()
503149
@Override
    protected void doExecute() throws Exception {
        if (skip) {
            return;
        }

        if (features == null) {
            // For liberty-assembly integration:
            // When using installUtility, if no features section was specified, 
            // then don't install features because it requires license acceptance
            noFeaturesSection = true;
            
            // initialize features section for all scenarios except for the above
            features = new Features();
        }

        checkServerHomeExists();
        installFeatures();
    }
693736
final int doExec() {
        int s; boolean completed;
        if ((s = status) >= 0) {
            try {
                completed = exec();
            } catch (Throwable rex) {
                return setExceptionalCompletion(rex);
            }
            if (completed)
                s = setCompletion(NORMAL);
        }
        return s;
    }
1321311
public void execute()
            throws MojoExecutionException {

        if (! watch) {
            removeFromWatching();
        }

        if (extensions == null || extensions.isEmpty()) {
            extensions = ImmutableList.of("ad", "asciidoc", "adoc");
        }

        if (instance == null) {
            instance = getAsciidoctorInstance();
        }

        final OptionsBuilder optionsBuilderExternals = OptionsBuilder.options().compact(compact)
                .safe(SafeMode.UNSAFE).eruby(eruby).backend(backend).docType(doctype).headerFooter(headerFooter).inPlace(true);

        final OptionsBuilder optionsBuilderInternals = OptionsBuilder.options().compact(compact)
                .safe(SafeMode.UNSAFE).eruby(eruby).backend(backend).docType(doctype).headerFooter(headerFooter).inPlace(true);

        if (templateEngine != null) {
            optionsBuilderExternals.templateEngine(templateEngine);
            optionsBuilderInternals.templateEngine(templateEngine);
        }

        if (templateDir != null) {
            optionsBuilderExternals.templateDir(templateDir);
            optionsBuilderInternals.templateDir(templateDir);
        }

        if (sourceHighlighter != null) {
            attributes.put("source-highlighter", sourceHighlighter);
        }

        if (embedAssets) {
            attributes.put("linkcss!", true);
            attributes.put("data-uri", true);
        }

        if (imagesDir != null) {
            attributes.put("imagesdir", imagesDir);
        }

        if (stylesheet != null) {
            attributes.put(Attributes.STYLESHEET_NAME, stylesheet);
            attributes.put(Attributes.LINK_CSS, true);
        }

        if (stylesheetDir != null) {
            attributes.put(Attributes.STYLES_DIR, stylesheetDir);
        }

        optionsBuilderExternals.attributes(attributes);
        optionsBuilderInternals.attributes(attributes);

        IOFileFilter filter = null;
        if (includes != null && includes.length != 0) {
            filter = new WildcardFileFilter(includes);
            if (excludes != null && excludes.length != 0) {
                filter = new AndFileFilter(filter, new NotFileFilter(new WildcardFileFilter(excludes)));
            }
        }
        try {
            for (File file : getResources(extensions)) {
                if (filter == null || filter.accept(file)) {
                    renderFile(optionsBuilderExternals.asMap(), file);
                }
            }
        } catch (IOException e) {
            throw new MojoExecutionException("Error while compiling AsciiDoc file", 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));
    }
10040
@Override
    public final void execute() throws TaskExecutionFailedException {
        long startTime = System.currentTimeMillis();

        try {
            executeImpl();
            log.info(createMessage("success", System.currentTimeMillis() - startTime));
        } catch (TaskExecutionFailedException ex) {
            log.error(createMessage("failure", System.currentTimeMillis() - startTime));
            throw ex;
        }
    }
138203
@Override
    public void execute() throws MojoExecutionException {
        try {
            // Work around for Application Insights Java SDK:
            // Sometimes, NoClassDefFoundError will be thrown even after Maven build is completed successfully.
            // An issue has been filed at https://github.com/Microsoft/ApplicationInsights-Java/issues/416
            // Before this issue is fixed, set default uncaught exception handler for all threads as work around.
            Thread.setDefaultUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());

            final Properties prop = new Properties();
            if (isFirstRun(prop)) {
                infoWithMultipleLines(PRIVACY_STATEMENT);
                updateConfigurationFile(prop);
            }

            if (isSkipMojo()) {
                info("Skip execution.");
                trackMojoSkip();
            } else {
                trackMojoStart();

                doExecute();

                trackMojoSuccess();
            }
        } catch (Exception e) {
            handleException(e);
        } finally {
            // When maven goal executes too quick, The HTTPClient of AI SDK may not fully initialized and will step
            // into endless loop when close, we need to call it in main thread.
            // Refer here for detail codes: https://github.com/Microsoft/ApplicationInsights-Java/blob/master/core/src
            // /main/java/com/microsoft/applicationinsights/internal/channel/common/ApacheSender43.java#L103
            try {
                // Sleep to wait ai sdk flush telemetries
                Thread.sleep(2 * 1000);
            } catch (InterruptedException e) {
                // swallow this exception
            }
            ApacheSenderFactory.INSTANCE.create().close();
        }
    }
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();
    }
991664
@Override
    public void execute() {
        try {
            String str = editor.readLine("Find:");
            editor.findNext(str);
            FindContext.setLastSearch(str);
        } catch (IOException e) {
            //noop
        }
    }
1330263
protected void doExecuteCommand() {
        if (this.commandExecutor instanceof ParameterizableActionCommandExecutor) {
            ((ParameterizableActionCommandExecutor) this.commandExecutor).execute(getParameters());
        }
        else {
        	if (this.commandExecutor != null) {
        		this.commandExecutor.execute();
        	}
        }
    }
874074
protected function doExecute()
    {
        $hard = $this->getOption('hard');

        // Prepare path
        $name = $this->io->getArgument(0);

        /** @var WebApplication $env */
        $env = $this->getOption('env');

        $resolver = ConsoleHelper::getAllPackagesResolver($env, $this->console);

        if (!$name) {
            throw new \InvalidArgumentException('No package input.');
        }

        $package = $resolver->getPackage($name);

        if ($package) {
            $dir = $package->getDir() . '/Resources/asset';
        } else {
            throw new \InvalidArgumentException('Package ' . $name . ' not found.');
        }

        if (!is_dir($dir)) {
            throw new \InvalidArgumentException(
                'This package has no <comment>/Resources/asset</comment> folder so nothing synced.'
            );
        }

        $folder = $this->console->get('asset.folder');
        $target = $this->getArgument(1, $name);
        $target = $this->console->get('path.public') . '/' . trim($folder, '/') . '/' . $target;

        $symlink = new Symlink();
        $force   = $this->getOption('force');

        if (is_link($target)) {
            if (!$force) {
                throw new \RuntimeException('Link ' . $target . ' already created.');
            }

            $this->out('Link file: <comment>' . $target . '</comment> exists, force replace it.');

            File::delete($target);
        }

        if ($hard) {
            $this->hardCopy($dir, $target);

            $this->out('Copy folder ' . $dir . ' to ' . $target);
        } else {
            $this->out($symlink->make($dir, $target));

            if (!PlatformHelper::isWindows()) {
                $this->out('Link success <info>' . $dir . '</info> <====> <info>' . $target . '</info>');
            }
        }

        return true;
    }
1353360
@Override
    public void execute() throws MojoExecutionException {
        if (skipCleanCSS) {
            getLog().debug("Skipping CSS minification");
            removeFromWatching();
            return;
        }

        cleancss = NPM.npm(this, CLEANCSS_NPM_NAME, cleanCssVersion);
        getLog().info("Clean CSS version: " + cleanCssVersion);

        // Check whether or not we have a custom configuration
        if (stylesheets == null) {
            getLog().info("No 'stylesheets' processing configuration, minifying all '.css' files individually");
            for (File file : getResources(getExtensions())) {
                try {
                    process(file);
                } catch (WatchingException e) {
                    throw new MojoExecutionException(e.getMessage(), e);
                }
            }
        } else {
            process(stylesheets);
        }
    }
90610
@Override
    public void execute() throws MojoExecutionException {
        try {
            ensureNotExisting();
            createDirectories();

            if ("blank".equalsIgnoreCase(skel)) {
                createApplicationConfiguration();
                createBlankPomFile();
                createPackageStructure();
                copyDefaultErrorTemplates();
            } else {
                createApplicationConfiguration();
                createPomFile();
                createPackageStructure();
                createDefaultController();
                createTests();
                copyAssets();
                createWelcomeTemplate();
                copyDefaultErrorTemplates();
            }

            printStartGuide();
        } catch (IOException e) {
            throw new MojoExecutionException("Error during project generation", e);
        }
    }
595245
public static void asyncExecute(Runnable runnable) {
		if (runnable != null) {
			try {
				Para.getExecutorService().execute(runnable);
			} catch (RejectedExecutionException ex) {
				logger.warn(ex.getMessage());
				try {
					runnable.run();
				} catch (Exception e) {
					logger.error(null, e);
				}
			}
		}
	}
79826
public void executeMojo(MojoExecution mojo) throws MojoExecutionException, MojoFailureException {
		try {
			this.buildPluginManager.executeMojo(this.session, mojo);
		} catch (PluginConfigurationException
				| PluginManagerException e) {
			throw new MojoFailureException(e.getLocalizedMessage(), e);
		}
	}
1111996
@Override
    public void doExecute() throws MojoExecutionException {
        getLog().info(" ");
        getLog().info(LINE_SEPARATOR);
        getLog().info(" P E R F O R M A N C E    T E S T S");
        getLog().info(LINE_SEPARATOR);
        getLog().info(" ");

        if (!testFilesDirectory.exists()) {
            getLog().info("<testFilesDirectory>" + testFilesDirectory.getAbsolutePath() + "</testFilesDirectory> does not exist...");
            getLog().info("Performance tests skipped!");
            getLog().info(" ");
            return;
        }

        TestConfig testConfig = new TestConfig(new File(testConfigFile));
        JMeterConfigurationHolder configuration = JMeterConfigurationHolder.getInstance();
        remoteConfig.setPropertiesMap(configuration.getPropertiesMap());
        jMeterProcessJVMSettings.setHeadlessDefaultIfRequired();
        copyFilesInTestDirectory(testFilesDirectory, testFilesBuildDirectory);
        TestManager jMeterTestManager = new TestManager()
                .setBaseTestArgs(computeJMeterArgumentsArray(true, testConfig.getResultsOutputIsCSVFormat()))
                .setTestFilesDirectory(testFilesBuildDirectory)
                .setTestFilesIncluded(testFilesIncluded)
                .setTestFilesExcluded(testFilesExcluded)
                .setRemoteServerConfiguration(remoteConfig)
                .setSuppressJMeterOutput(suppressJMeterOutput)
                .setBinDir(configuration.getWorkingDirectory())
                .setJMeterProcessJVMSettings(jMeterProcessJVMSettings)
                .setRuntimeJarName(configuration.getRuntimeJarName())
                .setReportDirectory(reportDirectory)
                .setGenerateReports(generateReports)
                .setPostTestPauseInSeconds(postTestPauseInSeconds);
        if (proxyConfig != null) {
            getLog().info(this.proxyConfig.toString());
        }

        testConfig.setResultsFileLocations(jMeterTestManager.executeTests());
        testConfig.writeResultFilesConfigTo(testConfigFile);
    }
1371938
@Override
    public void execute() throws MojoExecutionException {
        if (StringUtils.isBlank(this.refreshPort)) {
            this.refreshPort = "8080";
        }

        // Do a ping to see if the server is up, if not, log and just exit
        if (!ping()) {
            getLog().warn("Connection failed to " + this.refreshHost + ":" + this.refreshPort + ", " + getAbortedMsg());
            return;
        }

        executeRefresh();
    }
62697
@Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        generatingSite = false;
        final boolean shouldSkip = Boolean.parseBoolean(System.getProperty("dependency-check.skip", Boolean.toString(skip)));
        if (shouldSkip) {
            getLog().info("Skipping " + getName(Locale.US));
        } else {
            project.setContextValue("dependency-check-output-dir", this.outputDirectory);
            runCheck();
        }
    }