{@inheritDoc}

@see org.apache.maven.plugin.Mojo#execute()
321186
public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        if ( !noserver )
        {
            // Jetty requires an exploded webapp
            setupExplodedWar();
        }
        else
        {
            getLog().info( "noServer is set! Skipping exploding war file..." );
        }

        for ( String module : getModules() )
        {
            createLaunchConfigurationForHostedModeBrowser( module );
        }
    }
22385
public void execute() throws MojoExecutionException, MojoFailureException {
        if (skip) {
            getLog().info("Not executing specifications.");
        } else {
            prepareReportsDir();
            prepareRunnerExecutors();
            printBanner();
            try {
                runAllTests();
            } finally {
                printFooter();
                for (TestResultsIndex testResultsIndex : testResultsIndexes.values()) {
                    testResultsIndex.dump();
                }
            }
            checkTestsResults();
        }
    }
807324
public void execute()
        throws MojoFailureException
    {
        Interpreter interpreter = new Interpreter();

        set( interpreter, "project", getProject() );
        set( interpreter, "session", mavenSession );
        set( interpreter, "settings", settings );

        try
        {
            interpreter.eval( source );
        }
        catch ( EvalError ee )
        {
            MojoFailureException mfe =
                new MojoFailureException( "error during Beanshell script execution: " + ee.getMessage() );
            mfe.initCause( ee );
            throw mfe;
        }

        if ( properties != null )
        {
            for ( String property : properties )
            {
                Object value;
                try
                {
                    value = interpreter.get( property );

                    if ( value != null )
                    {
                        defineProperty( property, value.toString() );
                    }
                }
                catch ( EvalError ee )
                {
                    MojoFailureException mfe = new MojoFailureException( "cannot get Beanshell global variable '"
                        + property + "': " + ee.getMessage() );
                    mfe.initCause( ee );
                    throw mfe;
                }
            }
        }
    }
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));
    }
808516
public void execute() throws MojoExecutionException {
        try {
            repositoryPath = findRepoPath(this.ceylonRepository);
            ArtifactRepositoryLayout layout = new CeylonRepoLayout();
            getLog().debug("Layout: " + layout.getClass());

            localRepository =
                new DefaultArtifactRepository(ceylonRepository, 
                    repositoryPath.toURI().toURL().toString(), layout);
            getLog().debug("Repository: " + localRepository);
        } catch (MalformedURLException e) {
            throw new MojoExecutionException("MalformedURLException: " + e.getMessage(), e);
        }
        
        if (project.getFile() != null) {
            readModel(project.getFile());
        }
        
        if (skip) {
            getLog().info("Skipping artifact installation");
            return;
        }

        if (!installAtEnd) {
            installProject(project);
        } else {
            MavenProject lastProject = reactorProjects.get(reactorProjects.size() - 1);
            if (lastProject.equals(project)) {
                for (MavenProject reactorProject : reactorProjects) {
                    installProject(reactorProject);
                }
            } else {
                getLog().info("Installing " + project.getGroupId() + ":" + project.getArtifactId() + ":"
                                   + project.getVersion() + " at end");
            }
        }
    }
1236147
public void execute()
            throws MojoExecutionException {
        if (watchFilter == null) {
            removeFromWatching();
        }
        NPM.npm(this, name, version).execute(
                binary != null ? binary : name, arguments);
    }
818076
@Override
	public void execute() throws MojoExecutionException, MojoFailureException {
	    try {
			final ResourcesAggregator aggr = this.createResourcesAggregator();
			
			final File fullOutputDirectory = new File(baseOutputDirectory, skinOutputDirectory);
			this.doAggregation(aggr, skinConfigurationFile, fullOutputDirectory);
		} catch (AggregationException e) {
			throw new MojoExecutionException("aggregation failed", e);
		} catch (IOException e) {
			throw new MojoExecutionException("IOException occurred", e);
		}
	}
180049
@Override
   public void execute()  throws MojoExecutionException, MojoFailureException
   {
      ClassLoader oldCL = SecurityActions.getThreadContextClassLoader();
      try 
      {
         SecurityActions.setThreadContextClassLoader(SecurityActions.getClassLoader(ValidatorMojo.class));

         Validation.validate(getRarFile().toURI().toURL(), 
            getOutputDir(), getClasspath());
      }
      catch (Throwable t) 
      {
         t.printStackTrace();
      }
      finally
      {
         SecurityActions.setThreadContextClassLoader(oldCL);
      }
   }
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();
    }
1162449
public void execute() throws MojoExecutionException {

        if (!featuresDirectory.exists()) {
            throw new MojoExecutionException("Features directory does not exist");
        }

        final Collection<File> featureFiles = listFiles(featuresDirectory, new String[] {"feature"}, true);
        final List<File> sortedFeatureFiles = new NameFileComparator().sort(new ArrayList<File>(featureFiles));

        createOutputDirIfRequired();

        File packageDirectory = packageName == null
                ? outputDirectory
                : new File(outputDirectory, packageName.replace('.','/'));

        if (!packageDirectory.exists()) {
            packageDirectory.mkdirs();
        }

        final CucumberITGenerator fileGenerator = createFileGenerator();
        fileGenerator.generateCucumberITFiles(packageDirectory, sortedFeatureFiles);

        getLog().info("Adding " + outputDirectory.getAbsolutePath()
                        + " to test-compile source root");

        project.addTestCompileSourceRoot(outputDirectory.getAbsolutePath());
    }
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);
			}
		}
	}
1330759
public void execute() throws MojoExecutionException, MojoFailureException {
        try {
            removeFromResources(blocksDir);
            removeFromResources(resourcesDir);
            File targetDir = new File(outputDir);
            boolean jar = "jar".equalsIgnoreCase(mavenProject.getPackaging());
            if (jar) {
                JarBuilder builder = new JarBuilder(blocksDir, resourcesDir, targetDir, mavenProject, mavenSession, getLog());
                builder.generate();
            } else {
                WarBuilder builder = new WarBuilder(blocksDir, resourcesDir, targetDir, mavenProject, mavenSession, getLog());
                builder.generate();
            }
        } catch (Exception e) {
            throw new MojoFailureException("Source generator error", e);
        }
    }
521998
@Override
    public void execute()
            throws MojoExecutionException, MojoFailureException
        {
        boolean fExplicit = this.script != null;
        String  script    = fExplicit
                            ? this.script
                            : execution.getLifecyclePhase();

        String SCRIPT_NOT_FOUND = "Script '" + script + "' is not defined in package.json";

        Package pkg = getPackage();
        if (fExplicit && !pkg.hasScript(script))
            {
            getLog().error(SCRIPT_NOT_FOUND);
            throw new MojoFailureException(SCRIPT_NOT_FOUND);
            }
        else if (pkg.hasScript(script))
            {
            if (!fExplicit && script.endsWith("test") && skipTests)
                {
                getLog().info("Tests are skipped.");
                }
            else
                {
                CommandLine cmdLine = getNpmCommand();
                addCommand(cmdLine);
                cmdLine.addArgument(script);
                addArguments(cmdLine);

                execute(cmdLine);
                }
            }
        else
            {
            getLog().info(SCRIPT_NOT_FOUND);
            }
        }
1035131
public void execute() throws MojoExecutionException {
        
        if (jar == null || !jar.exists()) {
            if (gavExists()) { // attempt to resolve jar from GAV
                DefaultArtifactResolver resolver = new DefaultArtifactResolver();
                ArtifactResolutionResult result = resolver.resolve(new ArtifactResolutionRequest()
                    .setArtifact(new DefaultArtifact(groupId, artifactId, version, null, "jar", null, 
                        new DefaultArtifactHandler("jar")))
                );
                
                if (result.isSuccess()) {
                    jar = result.getArtifacts().iterator().next().getFile();
                } else {
                    String message = "Jar file '" + jar.getPath() + "' not specified and "
                        + "GAV coordinates could not be resolved";
                    getLog().error(message);
                    throw new MojoExecutionException(message);                    
                }
            } else {
                String message = "Jar file '" + jar.getPath() + "' does not exixt and "
                    + "GAV coordinates not specified";
                getLog().error(message);
                throw new MojoExecutionException(message);
            }
        }
        
        try {
            repositoryPath = findRepoPath(this.ceylonRepository);
            ArtifactRepositoryLayout layout = new CeylonRepoLayout();
            getLog().debug("Layout: " + layout.getClass());

            localRepository =
                new DefaultArtifactRepository(ceylonRepository, repositoryPath.toURI().toURL().toString(), layout);
            getLog().debug("Repository: " +  localRepository);
        } catch (MalformedURLException e) {
            throw new MojoExecutionException("MalformedURLException: " + e.getMessage(), e);
        }
        
        if (pomFile != null) { // explicitly specified
           processModel(readModel(pomFile));
        } else if (new File(jar.getParentFile(), "pom.xml").exists()) { // pom.xml in the same directory
            processModel(readModel(new File(jar.getParentFile(), "pom.xml"))); 
        } else {
            boolean foundPom = false;

            try {
                Pattern pomEntry = Pattern.compile("META-INF/maven/.*/pom\\.xml");

                JarFile jarFile = new JarFile(jar);

                Enumeration<JarEntry> jarEntries = jarFile.entries();

                while (jarEntries.hasMoreElements()) {
                    JarEntry entry = jarEntries.nextElement();

                    if (pomEntry.matcher(entry.getName()).matches()) {
                        getLog().debug("Using " + entry.getName() + " for groupId, artifactId, packaging and version");
                        foundPom = true;
                        InputStream pomInputStream = null;

                        try {
                            pomInputStream = jarFile.getInputStream(entry);
                            processModel(readModel(pomInputStream));
                            break;
                        } finally {
                            if (pomInputStream != null) {
                                pomInputStream.close();
                            } 
                            if (jarFile != null) {
                                jarFile.close();
                            }                            
                        }
                    }
                }

                if (!foundPom) {
                    getLog().info("pom.xml not found in " + jar.getName());
                }
            } catch (IOException e) {
                getLog().warn("This jar file was not packaged by Maven");
            }
        }
        // if packaging is set, check it
        if (packaging != null & !"jar".equals(packaging)) {
            throw new MojoExecutionException("POM packaging is not 'jar' ");
        }
        
        if (!jar.getName().endsWith(".jar")) {
            throw new MojoExecutionException("Jar File extension must be 'jar'  ");
        }
    
        if (groupId == null || "".equals(groupId)) {
            throw new MojoExecutionException("Group Id is empty  ");
        }
  
        if (artifactId == null || "".equals(artifactId)) {
            throw new MojoExecutionException("Artifact Id is empty  ");
        }
 
        if (version == null || "".equals(version)) {
            throw new MojoExecutionException("Version is empty  ");
        }
        
        installJar(jar);
    }
991664
@Override
    public void execute() {
        try {
            String str = editor.readLine("Find:");
            editor.findNext(str);
            FindContext.setLastSearch(str);
        } catch (IOException e) {
            //noop
        }
    }
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();
    }
70803
public static void execute(Object mojo) throws Exception {
        // Note that the object can be an instance of
        // AbstractSurefireMojo.
        if (!(isSurefirePlugin(mojo) || isFailsafePlugin(mojo))) {
            return;
        }
        // Check if the same object is already invoked.  This may
        // happen (in the future) if execute method is in both
        // AbstractSurefire and SurefirePlugin classes.
        if (isAlreadyInvoked(mojo)) {
            return;
        }

        // Check if surefire version is supported.
        checkSurefireVersion(mojo);
        // Check surefire configuration.
        checkSurefireConfiguration(mojo);

        try {
            // Update argLine.
            updateArgLine(mojo);
            // Update excludes.
            updateExcludes(mojo);
            // Update parallel.
            updateParallel(mojo);
        } catch (Exception ex) {
            // This exception should not happen in theory.
            throwMojoExecutionException(mojo, "Unsupported surefire version", ex);
        }
    }