Ensures that the file system server is started (if already starting, will block until started, otherwise starts
the file system server and blocks until started)

@throws MojoExecutionException if the file system server could not be started.
346739
public void ensureStarted()
        throws MojoExecutionException
    {
        synchronized ( lock )
        {
            if ( started || starting )
            {
                return;
            }
            starting = true;
            started = false;
            finished = false;
            finishing = false;
        }
        Thread worker = new Thread( new Worker(), "FileSystemServer[" + name + "]" );
        worker.setDaemon( true );
        worker.start();
        try
        {
            synchronized ( lock )
            {
                while ( starting && !started && !finished && !finishing )
                {
                    lock.wait();
                }
                if ( problem != null )
                {
                    throw problem;
                }
            }
        }
        catch ( Exception e )
        {
            throw new MojoExecutionException( e.getMessage(), e );
        }
    }
733323
private void checkIfEkstaziDirCanBeCreated() throws MojoExecutionException {
        File ekstaziDir = Config.createRootDir(parentdir);
        // If .ekstazi does not exist and cannot be created, let them
        // know.  (We also remove directory if successfully created.)
        if (!ekstaziDir.exists() && (!ekstaziDir.mkdirs() || !ekstaziDir.delete())) {
            throw new MojoExecutionException("Cannot create Ekstazi directory in " + parentdir);
        }
    }
213230
@Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        if (this.skipFormatting) {
            getLog().info("Formatting is skipped");
            return;
        }

        long startClock = System.currentTimeMillis();

        if (StringUtils.isEmpty(this.encoding)) {
            this.encoding = ReaderFactory.FILE_ENCODING;
            getLog().warn("File encoding has not been set, using platform encoding (" + this.encoding
                    + ") to format source files, i.e. build is platform dependent!");
        } else {
            if (!Charset.isSupported(this.encoding)) {
                throw new MojoExecutionException("Encoding '" + this.encoding + "' is not supported");
            }
            getLog().info("Using '" + this.encoding + "' encoding to format source files.");
        }

        List<File> files = new ArrayList<>();
        if (this.directories != null) {
            for (File directory : this.directories) {
                if (directory.exists() && directory.isDirectory()) {
                    files.addAll(addCollectionFiles(directory));
                }
            }
        } else {
            // Using defaults of source main and test dirs
            if (this.sourceDirectory != null && this.sourceDirectory.exists() && this.sourceDirectory.isDirectory()) {
                files.addAll(addCollectionFiles(this.sourceDirectory));
            }
            if (this.testSourceDirectory != null && this.testSourceDirectory.exists()
                    && this.testSourceDirectory.isDirectory()) {
                files.addAll(addCollectionFiles(this.testSourceDirectory));
            }
        }

        int numberOfFiles = files.size();
        Log log = getLog();
        log.info("Number of files to be formatted: " + numberOfFiles);

        if (numberOfFiles > 0) {
            createCodeFormatter();
            ResultCollector rc = new ResultCollector();
            Properties hashCache = readFileHashCacheFile();

            String basedirPath = getBasedirPath();
            for (int i = 0, n = files.size(); i < n; i++) {
                File file = files.get(i);
                if (file.exists()) {
                    if (file.canWrite()) {
                        formatFile(file, rc, hashCache, basedirPath);
                    } else {
                        rc.readOnlyCount++;
                    }
                } else {
                    rc.failCount++;
                }
            }

            storeFileHashCache(hashCache);

            long endClock = System.currentTimeMillis();

            log.info("Successfully formatted:          " + rc.successCount + FILE_S);
            log.info("Fail to format:                  " + rc.failCount + FILE_S);
            log.info("Skipped:                         " + rc.skippedCount + FILE_S);
            log.info("Read only skipped:               " + rc.readOnlyCount + FILE_S);
            log.info("Approximate time taken:          " + ((endClock - startClock) / 1000) + "s");
        }
    }
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 );
        }
    }
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");
    }
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");
    }
877103
public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        if ( isSkipping() )
        {
            getLog().debug( "Skipping execution, as demanded by user." );
            return;
        }

        if ( useDefaultFormatFileSet )
        {
            formatFileSets.add( FormatFileSet.getDefault( getBasedir(), encoding, indentSize ) );
        }
        if ( formatFileSets == null || formatFileSets.isEmpty() )
        {
            /* nothing to do */
            return;
        }

        ViolationCollector violationCollector = new ViolationCollector();

        int processedFileCount = 0;

        for ( FormatFileSet formatFileSet : formatFileSets )
        {
            String effectiveEncoding = formatFileSet.getEncoding();
            if ( effectiveEncoding == null )
            {
                effectiveEncoding = this.encoding;
            }
            String[] includedFiles = scan( formatFileSet );
            for ( String includedPath : includedFiles )
            {
                processedFileCount++;
                File file = new File( formatFileSet.getDirectory(), includedPath );
                check( file, effectiveEncoding, violationCollector );
                if ( getLog().isDebugEnabled() && !violationCollector.hasViolations( file ) )
                {
                    getLog().debug( "No XML formatting violations found in file " + file.getAbsolutePath() );
                }
            }
        }
        getLog().debug( "Checked the formatting of " + processedFileCount + " files" );

        if ( failOnFormatViolation && violationCollector.hasViolations() )
        {
            throw new MojoFailureException( "There are XML formatting violations. Check the above log for details." );
        }

    }
1051907
protected void runCheck() throws MojoExecutionException, MojoFailureException {
        try (Engine engine = initializeEngine()) {
            ExceptionCollection exCol = scanDependencies(engine);
            try {
                engine.analyzeDependencies();
            } catch (ExceptionCollection ex) {
                exCol = handleAnalysisExceptions(exCol, ex);
            }
            if (exCol == null || !exCol.isFatal()) {

                File outputDir = getCorrectOutputDirectory(this.getProject());
                if (outputDir == null) {
                    //in some regards we shouldn't be writing this, but we are anyway.
                    //we shouldn't write this because nothing is configured to generate this report.
                    outputDir = new File(this.getProject().getBuild().getDirectory());
                }
                try {
                    final MavenProject p = this.getProject();
                    engine.writeReports(p.getName(), p.getGroupId(), p.getArtifactId(), p.getVersion(), outputDir, getFormat());
                } catch (ReportException ex) {
                    if (exCol == null) {
                        exCol = new ExceptionCollection(ex);
                    } else {
                        exCol.addException(ex);
                    }
                    if (this.isFailOnError()) {
                        throw new MojoExecutionException("One or more exceptions occurred during dependency-check analysis", exCol);
                    } else {
                        getLog().debug("Error writing the report", ex);
                    }
                }
                showSummary(this.getProject(), engine.getDependencies());
                checkForFailure(engine.getDependencies());
                if (exCol != null && this.isFailOnError()) {
                    throw new MojoExecutionException("One or more exceptions occurred during dependency-check analysis", exCol);
                }
            }
        } catch (DatabaseException ex) {
            if (getLog().isDebugEnabled()) {
                getLog().debug("Database connection error", ex);
            }
            final String msg = "An exception occurred connecting to the local database. Please see the log file for more details.";
            if (this.isFailOnError()) {
                throw new MojoExecutionException(msg, ex);
            }
            getLog().error(msg, ex);
        } finally {
            getSettings().cleanup();
        }
    }
270520
public void stop(AbstractWisdomMojo mojo) throws MojoExecutionException {
        File script = new File(mojo.getWisdomRootDirectory(), "chameleon.sh");
        if (!script.isFile()) {
            throw new MojoExecutionException("The 'chameleon.sh' file does not exist in " + mojo
                    .getWisdomRootDirectory().getAbsolutePath() + " - cannot stop the Wisdom instance");
        }

        // If there is a RUNNING_PID file, exit immediately.
        File pid = new File(mojo.getWisdomRootDirectory(), "RUNNING_PID");
        if (!pid.isFile()) {
            mojo.getLog().info("The RUNNING_PID file does not exist, are you sure Wisdom is running ?");
            return;
        }

        CommandLine cmdLine = new CommandLine(script);
        cmdLine.addArgument("stop");

        try {
            mojo.getLog().info("Stopping Wisdom Server using '" + cmdLine.toString() + "'.");
            // As we know which command line we are executing, we can safely execute the command.
            Runtime.getRuntime().exec(cmdLine.toStrings(), null, mojo.getWisdomRootDirectory()); //NOSONAR
        } catch (IOException e) {
            throw new MojoExecutionException("Cannot stop Wisdom", e);
        }
    }
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 );
        }

    }
458165
public void execute() throws MojoExecutionException, MojoFailureException {
    if (skip) {
      getLog().info("Skipping format check");
      return;
    }
    if ("pom".equals(packaging)) {
      getLog().info("Skipping format check: project uses 'pom' packaging");
      return;
    }
    if (skipSortingImports) {
      getLog().info("Skipping sorting imports");
    }
    List<File> directoriesToFormat = new ArrayList<File>();
    if (sourceDirectory.exists()) {
      directoriesToFormat.add(sourceDirectory);
    } else {
      handleMissingDirectory("Source", sourceDirectory);
    }
    if (testSourceDirectory.exists()) {
      directoriesToFormat.add(testSourceDirectory);
    } else {
      handleMissingDirectory("Test source", testSourceDirectory);
    }

    for (File additionalSourceDirectory : additionalSourceDirectories) {
      if (additionalSourceDirectory.exists()) {
        directoriesToFormat.add(additionalSourceDirectory);
      } else {
        handleMissingDirectory("Additional source", additionalSourceDirectory);
      }
    }

    Formatter formatter = getFormatter();

    for (File directoryToFormat : directoriesToFormat) {
      formatSourceFilesInDirectory(directoryToFormat, formatter);
    }

    logNumberOfFilesProcessed();
    postExecute(this.filesProcessed, this.nonComplyingFiles);
  }
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);
        }
    }
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);
        }
    }
1298381
public void stop()
			throws MojoExecutionException, IOException, InstanceNotFoundException {
		try {
			this.connection.invoke(this.objectName, "shutdown", null, null);
		}
		catch (ReflectionException ex) {
			throw new MojoExecutionException("Shutdown failed", ex.getCause());
		}
		catch (MBeanException ex) {
			throw new MojoExecutionException("Could not invoke shutdown operation", ex);
		}
	}
638390
public void execute() throws MojoExecutionException, MojoFailureException {
        try {
            final List<String> command = createCommand();
            checkWorkingDirectory();
            final int status = execute(command);
            if (failOnAnsibleError && status != 0){
                throw new MojoFailureException("Non-zero exit status returned");
            }
        } catch (IOException e) {
            throw new MojoExecutionException("Unable to run playbook", e);
        } catch (InterruptedException e) {
            throw new MojoExecutionException("Run interrupted", 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());
    }
1326891
public void execute () throws MojoExecutionException, MojoFailureException
  {
    final GrammarInfo [] grammarInfos = scanForGrammars ();

    if (grammarInfos == null)
    {
      getLog ().info ("Skipping non-existing source directory: " + getSourceDirectory ());
      return;
    }
    else
      if (grammarInfos.length <= 0)
      {
        getLog ().info ("Skipping - all parsers are up to date");
      }
      else
      {
        determineNonGeneratedSourceRoots ();

        if (StringUtils.isEmpty (grammarEncoding))
        {
          getLog ().warn ("File encoding for grammars has not been configured, using platform default encoding, i.e. build is platform dependent!");
        }
        if (StringUtils.isEmpty (outputEncoding))
        {
          getLog ().warn ("File encoding for output has not been configured, defaulting to UTF-8!");
        }

        for (final GrammarInfo grammarInfo : grammarInfos)
        {
          processGrammar (grammarInfo);
        }

        getLog ().info ("Processed " + grammarInfos.length + " grammar" + (grammarInfos.length != 1 ? "s" : ""));
      }

    final Collection <File> compileSourceRoots = new LinkedHashSet <> (Arrays.asList (getCompileSourceRoots ()));
    for (final File file : compileSourceRoots)
    {
      addSourceRoot (file);
    }
  }