/*
(non-Javadoc)

@see org.apache.maven.plugin.AbstractMojo#execute()
546526
public void execute() throws MojoExecutionException, MojoFailureException {
		try {
			createBundles();
		} catch (Exception ex) {
			Logger logger = Logger.getLogger(JawrMojo.class.getName());
			if(ex instanceof ServletException){
				logger.log(Level.SEVERE, null, ((ServletException)ex).getRootCause());
			}else{
				logger.log(Level.SEVERE, null, ex);
			}
			throw new MojoFailureException("JAWR Maven plugin failed: " + ex.getLocalizedMessage());
		}
	}
374214
public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        File jarFile = new File( outputDirectory, finalName + ".jar" );
        File origJarFile = new File( outputDirectory, finalName + "-b4gwt.jar" );
        if ( origJarFile.exists() )
        {
            if ( !origJarFile.delete() )
            {
                throw new MojoExecutionException( "Error removing " + origJarFile );
            }
        }
        if ( !jarFile.renameTo( origJarFile ) )
        {
            throw new MojoExecutionException( "Error renaming " + jarFile + " to " + origJarFile );
        }

        MavenArchiver archiver = new MavenArchiver();

        archiver.setArchiver( jarArchiver );
        archiver.setOutputFile( jarFile );
        archive.setForced( false );
        // It is already created by maven-jar-plugin
        archive.setAddMavenDescriptor( false );

        Collection<ResourceFile> files = getAllResourceFiles();
        try
        {

            // Avoid annoying messages in log "com/package/Ccc.java already added, skipping"
            List<String> jarExcludes = new Vector<String>();

            // Add Sources first since they may already be present in jar from previous run and changed.
            for ( ResourceFile file : files )
            {
                jarArchiver.addFile( new File( file.basedir, file.fileRelativeName ), file.fileRelativeName );
                jarExcludes.add( file.fileRelativeName );
            }

            // Add the context of original jar excluding resources that we just added base on GWT descriptors
            jarArchiver.addArchivedFileSet( origJarFile, null, jarExcludes.toArray( new String[jarExcludes.size()] ) );

            archiver.createArchive( session , getProject(), archive );
        }
        catch ( Exception e )
        {
            throw new MojoExecutionException( "Error assembling JAR", e );
        }

    }
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");
				}
			}
		}
	}
183992
@Override
    public void execute()
        throws MojoExecutionException
    {
        if ( !canGenerateReport() )
        {
            getLog().info( "Skipping SCoverage report generation" );
            return;
        }

        try
        {
            RenderingContext context = new RenderingContext( outputDirectory, getOutputName() + ".html" );
            SiteRendererSink sink = new SiteRendererSink( context );
            Locale locale = Locale.getDefault();
            generate( sink, locale );
        }
        catch ( MavenReportException e )
        {
            String prefix = "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation";
            throw new MojoExecutionException( prefix + ": " + e.getMessage(), e );
        }
    }
1099466
@SuppressWarnings("unchecked")
    public void execute()
        throws MojoExecutionException, CompilationFailureException
    {
        // ----------------------------------------------------------------------
        // Look up the compiler. This is done before other code than can
        // cause the mojo to return before the lookup is done possibly resulting
        // in misconfigured POMs still building.
        // ----------------------------------------------------------------------

        Compiler compiler;

        getLog().debug( "Using compiler '" + compilerId + "'." );

        try
        {
            compiler = compilerManager.getCompiler( compilerId );
        }
        catch ( NoSuchCompilerException e )
        {
            throw new MojoExecutionException( "No such compiler '" + e.getCompilerId() + "'." );
        }

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        List compileSourceRoots = removeEmptyCompileSourceRoots( getCompileSourceRoots() );

        if ( compileSourceRoots.isEmpty() )
        {
            getLog().info( "No sources to compile" );

            return;
        }

        if ( getLog().isDebugEnabled() )
        {
            getLog().debug( "Source directories: " + compileSourceRoots.toString().replace( ',', '\n' ) );
            getLog().debug( "Classpath: " + getClasspathElements().toString().replace( ',', '\n' ) );
            getLog().debug( "Output directory: " + getOutputDirectory() );
        }

        // ----------------------------------------------------------------------
        // Create the compiler configuration
        // ----------------------------------------------------------------------

        CompilerConfiguration compilerConfiguration = new CompilerConfiguration();

        compilerConfiguration.setOutputLocation( getOutputDirectory().getAbsolutePath() );

        compilerConfiguration.setClasspathEntries( getClasspathElements() );

        compilerConfiguration.setSourceLocations( compileSourceRoots );

        compilerConfiguration.setOptimize( optimize );

        compilerConfiguration.setDebug( debug );

        compilerConfiguration.setVerbose( verbose );

        compilerConfiguration.setShowWarnings( showWarnings );

        compilerConfiguration.setShowDeprecation( showDeprecation );

        compilerConfiguration.setSourceVersion( source );

        compilerConfiguration.setTargetVersion( target );

        compilerConfiguration.setSourceEncoding( encoding );

        if ( compilerArguments != null )
        {
            LinkedHashMap cplrArgsCopy = new LinkedHashMap();
            for (Object o : compilerArguments.entrySet()) {
                Map.Entry me = (Map.Entry) o;
                String key = (String) me.getKey();
                if (!key.startsWith("-")) {
                    key = "-" + key;
                }
                cplrArgsCopy.put(key, me.getValue());
            }
            compilerConfiguration.setCustomCompilerArguments( cplrArgsCopy );
        }

        compilerConfiguration.setFork( fork );

        compilerConfiguration.setExecutable( executable );

        compilerConfiguration.setWorkingDirectory( basedir );

        compilerConfiguration.setCompilerVersion( compilerVersion );

        compilerConfiguration.setBuildDirectory( buildDirectory );

        compilerConfiguration.setOutputFileName( outputFileName );

        Set staleSources;

        boolean canUpdateTarget;

        try
        {
            staleSources =
                computeStaleSources( compilerConfiguration, compiler, getSourceInclusionScanner( staleMillis ) );

            canUpdateTarget = compiler.canUpdateTarget( compilerConfiguration );

            if ( compiler.getCompilerOutputStyle().equals( CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES ) &&
                !canUpdateTarget )
            {
                getLog().info( "RESCANNING!" );
                String inputFileEnding = compiler.getInputFileEnding( compilerConfiguration );

                Set sources = computeStaleSources( compilerConfiguration, compiler,
                                                   getSourceInclusionScanner( inputFileEnding ) );

                compilerConfiguration.setSourceFiles( sources );
            }
            else
            {
                compilerConfiguration.setSourceFiles( staleSources );
            }
        }
        catch ( CompilerException e )
        {
            throw new MojoExecutionException( "Error while computing stale sources.", e );
        }

        if ( staleSources.isEmpty() )
        {
            getLog().info( "Nothing to compile - all classes are up to date" );

            return;
        }

        // ----------------------------------------------------------------------
        // Dump configuration
        // ----------------------------------------------------------------------

        if ( getLog().isDebugEnabled() )
        {
            getLog().debug( "Classpath:" );

            for (Object o : getClasspathElements()) {
                String s = (String) o;

                getLog().debug(" " + s);
            }

            getLog().debug( "Source roots:" );

            for (Object o : getCompileSourceRoots()) {
                String root = (String) o;

                getLog().debug(" " + root);
            }

            if ( fork )
            {
                try
                {
                    String[] cl = compiler.createCommandLine( compilerConfiguration );
                    if ( cl != null && cl.length > 0 )
                    {
                        StringBuffer sb = new StringBuffer();
                        sb.append( cl[0] );
                        for ( int i = 1; i < cl.length; i++ )
                        {
                            sb.append( " " );
                            sb.append( cl[i] );
                        }
                        getLog().debug( "Command line options:" );
                        getLog().debug( sb );
                    }
                }
                catch ( CompilerException ce )
                {
                    getLog().debug( ce );
                }
            }
        }

        // ----------------------------------------------------------------------
        // Compile!
        // ----------------------------------------------------------------------

        List<CompilerError> messages;

        try
        {
            messages = compiler.compile( compilerConfiguration );
        }
        catch ( Exception e )
        {
            throw new MojoExecutionException( "Fatal error compiling", e );
        }

        boolean compilationError = false;

        for ( CompilerError message : messages)
        {
            if ( message.isError() )
            {
                compilationError = true;
            }
        }

        if ( compilationError )
        {
            throw new CompilationFailureException( messages );
        }
        else
        {
            for (CompilerError message : messages) {
                getLog().warn(message.toString());
            }
        }
    }
344853
@Override
    public void execute() throws MojoExecutionException {


        coffee = npm(this, COFFEE_SCRIPT_NPM_NAME, coffeeScriptVersion);

        try {
            if (getInternalAssetsDirectory().isDirectory()) {
                getLog().info("Compiling CoffeeScript files from " + getInternalAssetsDirectory().getAbsolutePath());
                invokeCoffeeScriptCompiler(getInternalAssetsDirectory(), getInternalAssetOutputDirectory());
            }

            if (getExternalAssetsDirectory().isDirectory()) {
                getLog().info("Compiling CoffeeScript files from " + getExternalAssetsDirectory().getAbsolutePath());
                invokeCoffeeScriptCompiler(getExternalAssetsDirectory(), getExternalAssetsOutputDirectory());
            }
        } catch (WatchingException e) {
            throw new MojoExecutionException("Error during the CoffeeScript compilation", e);
        }
    }
1079058
@Override
    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

        nameValidator.validate(operation);
        final String attributeName = operation.require(NAME).asString();

        final ModelNode submodel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel();
        final ModelNode currentValue = submodel.get(attributeName).clone();

        context.getResult().set(currentValue);
    }
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);
        }
    }
1336037
public void execute() throws MojoExecutionException {
        ClassLoader classloader;
        
        try {
            classloader= createClassLoader();
        } catch (Exception e) {
            throw new MojoExecutionException("could not create classloader from dependencies", e);
        }
        
        AbstractConfiguration[] configurations;
        
        try {
            configurations= ConfigurationGenerator.execute(generatedSourceDirectory, applicationDefinition, classloader, getSLF4JLogger());
        } catch (Exception e) {
            throw new MojoExecutionException("could not generate the configurator", e);
        }
        
        getPluginContext().put(GENERATED_CONFIGURATIONS_KEY, configurations);
        project.addCompileSourceRoot(generatedSourceDirectory.getPath());
    }
40049
public void execute() {
    try {
      Command command = new Parser().parse();
      try {
        command.execute(new ContextImpl(), execute);
        close();
      } catch (Exception e) {
        throw new RuntimeException(
            "Error while executing command " + command, e);
      } catch (AssertionError e) {
        throw new RuntimeException(
            "Error while executing command " + command, e);
      }
    } finally {
      try {
        reader.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
      writer.close();
      try {
        close();
      } catch (SQLException e) {
        // ignore
      }
    }
  }
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;
                }
            }
        }
    }
865479
@Override
	public void execute() {
		if (target instanceof WComponentGroup<?>) {
			for (WComponent component : ((WComponentGroup<WComponent>) target).getComponents()) {
				if (component instanceof SubordinateTarget) {
					applyAction((SubordinateTarget) component, value);
				}
			}
		} else {
			// Leaf.
			applyAction(target, value);
		}

	}
77836
@Override
    public WarpResult execute() {
        try {
            executeWarp.fire(new ExecuteWarp(activity, warpContext));

            Exception executionException = warpContext.getFirstException();
            if (executionException != null) {
                propagateException(executionException);
            }

            return warpContext.getResult();
        } finally {
            finalizeContext();
        }
    }
1246977
@Override
    public void execute() throws MojoExecutionException {
        if (typescript == null) {
            typescript = new TypeScript();
        }

        if (!typescript.isEnabled()) {
            removeFromWatching();
            getLog().info("Typescript processing disabled");
            return;
        }

        npm = npm(this, TYPE_SCRIPT_NPM_NAME, typescript.getVersion());
        this.internalSources = new File(basedir, MAIN_RESOURCES_DIR);
        this.destinationForInternals = new File(buildDirectory, "classes");

        this.externalSources = new File(basedir, ASSETS_SRC_DIR);
        this.destinationForExternals = new File(getWisdomRootDirectory(), ASSETS_DIR);

        try {
            if (internalSources.isDirectory()) {
                getLog().info("Compiling TypeScript files with 'tsc' from " + internalSources.getAbsolutePath());
                processDirectory(internalSources, destinationForInternals);
            }

            if (externalSources.isDirectory()) {
                getLog().info("Compiling TypeScript files with 'tsc' from " + externalSources.getAbsolutePath());
                processDirectory(externalSources, destinationForExternals);
            }
        } catch (WatchingException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
1065524
@Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        super.execute();

        // scan classes and build graph
        try {
            processClasspaths();
        } catch (Exception e) {
            throw new MojoExecutionException("Error processing entity classes", e);
        }
    }
733812
public <T> T execute(final Object[] args, final Class<T> clazz) {
        return execute(args, clazz, true);
    }
617787
@Override
   public void execute() throws BuildException 
   {
      ClassLoader oldCL = SecurityActions.getThreadContextClassLoader();
      try 
      {
         SecurityActions.setThreadContextClassLoader(SecurityActions.getClassLoader(ValidatorTask.class));

         Validation.validate(new File(getRarFile()).toURI().toURL(), 
            getOutputDir(), getCommandLine().getClasspath().list());
      }
      catch (Throwable t) 
      {
         throw new BuildException(t.getMessage(), t);
      }
      finally
      {
         SecurityActions.setThreadContextClassLoader(oldCL);
      }
   }