Finds and compiles coffeescript files.

@throws MojoExecutionException if the compilation failed.
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);
        }
    }
1321779
@Override
    public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        if ( !"pom".equals( project.getPackaging() ) )
        {
            long ts = System.currentTimeMillis();
            try
            {
                internalExecute();
            }
            finally
            {
                long te = System.currentTimeMillis();
                getLog().debug( String.format( "Mojo execution time: %d ms", te - ts ) );
            }
        }
    }
1072567
protected void executeSassScript(String sassScript) throws MojoExecutionException, MojoFailureException {
        final Log log = this.getLog();
        System.setProperty("org.jruby.embed.localcontext.scope", "threadsafe");

        log.debug("Execute SASS Ruby Script:\n" + sassScript);

        final ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
        final ScriptEngine jruby = scriptEngineManager.getEngineByName("jruby");
        try {
            CompilerCallback compilerCallback = new CompilerCallback(log);
            jruby.getBindings(ScriptContext.ENGINE_SCOPE).put("compiler_callback", compilerCallback);
            jruby.eval(sassScript);
            if (failOnError && compilerCallback.hadError()) {
                throw new MojoFailureException("SASS compilation encountered errors (see above for details).");
            }
        }
        catch (final ScriptException e) {
            throw new MojoExecutionException("Failed to execute SASS ruby script:\n" + sassScript, e);
        }
    }
829480
public function compileAll()
    {
        $this->emptyCompileDir();
        
        $this->compileOtherFiles();
        
        $manifestNames = $this->config()->precompile;
        
        foreach ($manifestNames as $manifest) {
            $ext = pathinfo($manifest, PATHINFO_EXTENSION);
            $paths = $this->findAllFiles($manifest);
            foreach ($paths as $path) {
                $this->compileFile(new File($ext, $path));
            }
        }
    }
104752
public void compile() throws JasperException, FileNotFoundException {
        createCompiler();
        if (jspCompiler.isOutDated()) {
            if (isRemoved()) {
                throw new FileNotFoundException(jspUri);
            }
            try {
                jspCompiler.removeGeneratedFiles();
                jspLoader = null;
                jspCompiler.compile();
                jsw.setReload(true);
                jsw.setCompilationException(null);
            } catch (JasperException ex) {
                // Cache compilation exception
                jsw.setCompilationException(ex);
                if (options.getDevelopment() && options.getRecompileOnFail()) {
                    // Force a recompilation attempt on next access
                    jsw.setLastModificationTest(-1);
                }
                throw ex;
            } catch (FileNotFoundException fnfe) {
                // Re-throw to let caller handle this - will result in a 404
                throw fnfe;
            } catch (Exception ex) {
                JasperException je = new JasperException(
                        Localizer.getMessage("jsp.error.unable.compile"),
                        ex);
                // Cache compilation exception
                jsw.setCompilationException(je);
                throw je;
            }
        }
    }
984873
public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        if ( isSkipping() )
        {
            getLog().debug( "Skipping execution, as demanded by user." );
            return;
        }

        final ValidationErrorHandler errorHandler = new ValidationErrorHandler();
        if ( validationSets == null || validationSets.length == 0 )
        {
            throw new MojoFailureException( "No ValidationSets configured." );
        }
        checkCatalogHandling();

        Object oldProxySettings = activateProxy();
        try
        {
            Resolver resolver = getResolver();
            for ( int i = 0; i < validationSets.length; i++ )
            {
                ValidationSet validationSet = validationSets[i];
                resolver.setXincludeAware(validationSet.isValidating() );
                resolver.setValidating( validationSet.isValidating() );
                validate( resolver, validationSet ,errorHandler);
            }
            List<ValidationErrorHandler.ErrorRecord> errorRecords=errorHandler.getErrors();
            if (!errorRecords.isEmpty()){
                final StringBuffer message=new StringBuffer();
                for(ValidationErrorHandler.ErrorRecord error:errorRecords){
                    appendMessage(message,error);
                }
                if (errorHandler.getErrorCount()+errorHandler.getFatalCount()>0){
                    throw new MojoExecutionException( message.toString());
                }
                else{
                    getLog().warn(message.toString());
                }
            }
        }
        finally
        {
            passivateProxy( oldProxySettings );
        }
    }
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());
    }
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();
        }
    }
879309
protected void extendProjectCompileRootsAndResources() throws MojoExecutionException {
		if (project != null) {
			try {
				extendCompileSourceRoots();
				extendResources(outletResDir, false);
				extendResources(outletResOnceDir, false);
				extendResources(outletResTestDir, true);
				extendResources(outletResTestOnceDir, true);
			} catch (Exception ex) {
				throw new MojoExecutionException("Could not extend the " + "projects compile paths", ex);
			}
		}
	}
1011577
public void execute() throws MojoFailureException, MojoExecutionException {
        // Validate
        validateArtifactInformation();

        Artifact artifact =
                artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, classifier );

        File existingFile = getLocalRepoFile(artifact);
        if (existingFile != null && existingFile.exists()) {
            System.out.println("Using cached remapped artifact "+ existingFile.getPath()); // delete file to reinstall
            return; // success
        }

        // Remap
        File outJar = null;
        try {
            // load input jar(s), as one combined jar (for jarmods)
            List<File> files = new ArrayList<File>();
            for (String filename : inJars) {
                files.add(FileLocator.getFile(filename));
            }
            Jar inJar = Jar.init(files);

            // temporary output file
            outJar = File.createTempFile(groupId + "." + artifactId + "-" + version, "." + packaging);

            // mappings
            JarMapping mapping = new JarMapping();
            if (excludedPackages != null) {
                for (String packageName : excludedPackages) {
                    mapping.addExcludedPackage(packageName);
                }
            }
            mapping.loadMappings(srgIn, reverse, numeric, inShadeRelocation, outShadeRelocation);
            mapping.setFallbackInheritanceProvider(new JarProvider(inJar));


            // access transformers
            RemapperProcessor preprocessor = null;
            if (accessTransformers != null) {
                AccessMap accessMap = new AccessMap();

                for (String filename : accessTransformers) {
                    if (filename != null && filename.length() != 0) {
                        accessMap.loadAccessTransformer(filename);
                    }
                }

                preprocessor = new RemapperProcessor(null, null, accessMap);
            }

            // Do the remap
            JarRemapper remapper = new JarRemapper(preprocessor, mapping);
            remapper.setGenerateAPI(generateAPI);
            remapper.remapJar(inJar, outJar);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new MojoExecutionException("Error creating remapped jar at "+outJar+": " + ex.getMessage(), ex);
        }

        // Replace main artifact with this remapped artifact
        if (replaceMainArtifact) {
            getLog().info("Replacing original artifact with remapped artifact.");
            File originalArtifact = project.getArtifact().getFile();
            originalArtifact.delete();
            if (!outJar.renameTo(originalArtifact)) {
                throw new MojoExecutionException("Error replacing remapped jar at "+originalArtifact+" with "+outJar);
            }
        }

        // Attach output artifact to this project
        if (attachArtifact) {
            if (attachArtifactClassifier == null || attachArtifactClassifier.equals("")) {
                attachArtifactClassifier = null;
            }

            getLog().info("Attaching artifact " + outJar.getPath());
            projectHelper.attachArtifact(project, attachArtifactType, attachArtifactClassifier, outJar);
        }

        // Install output artifact to local repository
        if (installArtifact) {
            installArtifact(artifact, outJar);
        }
    }
469851
@Override
    public void execute() throws MojoExecutionException {
        checkParameters();
        windowsModus = isWindows();
        if (windowsModus) {
            setWindowsVariables();
        } else {
            setLinuxVariables();
        }
        createDllFromWsdl();
    }
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());
    }
1280104
public void execute() throws MojoExecutionException {
        if (skipProject()) {
            getLog().info("POM project detected; skipping");
        }else {
            URLClassLoader classLoader = new URLClassLoader(generateClassPathUrls());
            List<Class<?>> interfaceClasses = loadServiceClasses(classLoader);
            Map<String, List<String>> serviceImplementations = findImplementations(classLoader, interfaceClasses);
            writeServiceFiles(serviceImplementations);
        }
    }
202659
@SuppressWarnings("unchecked")
    public void execute() throws MojoExecutionException {

        if (isSkip()) {
            if (getLog().isInfoEnabled()) {
                getLog().info("Skipping execution because of 'skip' option");
            }
            return;
        }

        ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler();
        if (!forceAjcCompile && !"java".equalsIgnoreCase(artifactHandler.getLanguage())) {
            getLog().warn("Not executing aspectJ compiler as the project is not a Java classpath-capable package");
            return;
        }

        // MASPECT-110:
        //
        // Only add the aspectSourcePathDir and testAspectSourcePathDir to their respective
        // compileSourceRoots if they actually exist and are directories... to avoid crashing
        // downstream plugins requiring/assuming that all entries within the compileSourceRoots
        // and testCompileSourceRoots are directories.
        //
        final File aspectSourcePathDir = FileUtils.resolveFile(basedir, aspectDirectory);
        final File testAspectSourcePathDir = FileUtils.resolveFile(basedir, testAspectDirectory);

        final String aspectSourcePath = aspectSourcePathDir.getAbsolutePath();
        final String testAspectSourcePath = testAspectSourcePathDir.getAbsolutePath();

        if (aspectSourcePathDir.exists() && aspectSourcePathDir.isDirectory()
                && !project.getCompileSourceRoots().contains(aspectSourcePath)) {
            getLog().debug("Adding existing aspectSourcePathDir [" + aspectSourcePath + "] to compileSourceRoots.");
            project.getCompileSourceRoots().add(aspectSourcePath);
        } else {
            getLog().debug("Not adding non-existent or already added aspectSourcePathDir [" + aspectSourcePath
                    + "] to compileSourceRoots.");
        }

        if (testAspectSourcePathDir.exists() && testAspectSourcePathDir.isDirectory()
                && !project.getTestCompileSourceRoots().contains(testAspectSourcePath)) {
            getLog().debug(
                    "Adding existing testAspectSourcePathDir [" + testAspectSourcePath + "] to testCompileSourceRoots.");
            project.getTestCompileSourceRoots().add(testAspectSourcePath);
        } else {
            getLog().debug("Not adding non-existent or already added testAspectSourcePathDir [" + testAspectSourcePath
                    + "] to testCompileSourceRoots.");
        }

        assembleArguments();

        if (!forceAjcCompile && !hasSourcesToCompile()) {
            getLog().warn("No sources found skipping aspectJ compile");
            return;
        }

        if (!forceAjcCompile && !isBuildNeeded()) {
            getLog().info("No modifications found skipping aspectJ compile");
            return;
        }

        if (getLog().isDebugEnabled()) {
            StringBuilder command = new StringBuilder("Running : ajc");

            for (String arg : ajcOptions) {
                command.append(' ').append(arg);
            }
            getLog().debug(command);
        }
        try {
            getLog().debug(
                    "Compiling and weaving " + resolvedIncludes.size() + " sources to " + getOutputDirectory());
            AjcHelper.writeBuildConfigToFile(ajcOptions, argumentFileName, getOutputDirectory());
            getLog().debug(
                    "Arguments file written : " + new File(getOutputDirectory(), argumentFileName).getAbsolutePath());
        } catch (IOException e) {
            throw new MojoExecutionException("Could not write arguments file to the target area", e);
        }

        final Main ajcMain = new Main();
        MavenMessageHandler mavenMessageHandler = new MavenMessageHandler(getLog());
        ajcMain.setHolder(mavenMessageHandler);

        synchronized (BIG_ASPECTJ_LOCK) {
            ajcMain.runMain(ajcOptions.toArray(new String[ajcOptions.size()]), false);
        }

        IMessage[] errors = mavenMessageHandler.getMessages(IMessage.ERROR, true);
        if (!proceedOnError && errors.length > 0) {
            throw CompilationFailedException.create(errors);
        }
    }
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);
			}
		}
	}
1236147
public void execute()
            throws MojoExecutionException {
        if (watchFilter == null) {
            removeFromWatching();
        }
        NPM.npm(this, name, version).execute(
                binary != null ? binary : name, arguments);
    }
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 );
        }

    }