Set the RepositoryMap used to get file information.
If the supplied map is invalid it will default to the pre-packaged one here.

@throws MojoExecutionException
323395
private void setRepositoryMapFile() throws MojoExecutionException {
        if (this.customRepositoryMap != null && !this.customRepositoryMap.isEmpty()) {
            File repositoryMap = getRepositoryMapFile(this.customRepositoryMap);
            if (repositoryMap.exists()) {
                checkRepositoryMapIsValid(repositoryMap);
                try {
                    this.xmlRepositoryMap = repositoryMap.toURI().toURL().openStream();
                } catch (IOException ioe) {
                    throw new MojoExecutionException(ioe.getLocalizedMessage());
                }
            } else {
                throw new MojoExecutionException("Repository map '" + repositoryMap.getAbsolutePath() + "' does not exist");
            }
        }

        if (this.xmlRepositoryMap == null) {
            this.xmlRepositoryMap = this.getClass().getResourceAsStream("/RepositoryMap.xml");
        }
    }
182127
public void execute(AbstractWisdomMojo mojo) throws MojoExecutionException {
        String version = PluginExtractor.getBuildPluginVersion(mojo, MAVEN_COMPILER_PLUGIN);
        if (version == null) {
            version = DEFAULT_VERSION;
        }
        final Plugin plugin = plugin(
                GROUP_ID,
                MAVEN_COMPILER_PLUGIN,
                version
        );

        Xpp3Dom configuration = PluginExtractor.getBuildPluginConfiguration(mojo, MAVEN_COMPILER_PLUGIN, COMPILE_GOAL);
        if (configuration == null) {
            Properties properties = mojo.project.getProperties();
            String source = properties.getProperty("maven.compiler.source", "1.7");
            String target = properties.getProperty("maven.compiler.target", "1.7");
            configuration = configuration(
                    element("compileSourceRoots", "${project.compileSourceRoots}"),
                    element("classpathElements", "${project.compileClasspathElements}"),
                    element("outputDirectory", "${project.build.outputDirectory}"),
                    element("projectArtifact", "${project.artifact}"),
                    element("generatedSourcesDirectory",
                            "${project.build.directory}/generated-sources/annotations"),
                    element("target", source),
                    element("source", target)
            );
        } else {
            mojo.getLog().debug("Loading maven-compiler-plugin configuration:");
            PluginExtractor.extractEligibleConfigurationForGoal(mojo, plugin, COMPILE_GOAL, configuration);
            mojo.getLog().debug(configuration.toString());

        }

        // Compile sources
        executeMojo(
                plugin,
                goal(COMPILE_GOAL),
                configuration,
                executionEnvironment(
                        mojo.project,
                        mojo.session,
                        mojo.pluginManager
                )
        );
    }
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);
      }
   }
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);
        }
    }
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");
    }
1374130
@Override
    public void execute()
            throws MojoExecutionException
    {
        if ( skip )
        {
            getLog().info( "Skipping JAR unsigning for file: " + jarPath.getAbsolutePath() );
            return;
        }
        if ( jarPath.isDirectory() )
        {
            for ( File jar : jarPath.listFiles() )
            {
                if ( JarSignerUtil.isZipFile( jar ) )
                {
                    signTool.unsign( jar, verbose );
                }
                else
                {
                    getLog().info( "Skipping JAR unsigning for file: " + jar.getAbsolutePath() );
                }
            }
        }
        else
        {
            signTool.unsign( this.jarPath, verbose );
        }
    }
446492
public void setRepositories(java.util.Collection<RepositoryMetadata> repositories) {
        if (repositories == null) {
            this.repositories = null;
            return;
        }

        this.repositories = new java.util.ArrayList<RepositoryMetadata>(repositories);
    }
660253
@Override
  public final void narExecute() throws MojoExecutionException, MojoFailureException {
    // download the dependencies if needed in local maven repository.
    List<AttachedNarArtifact> attachedNarArtifacts = getAttachedNarArtifacts(libraries);
    downloadAttachedNars(attachedNarArtifacts);

    // Warning, for SNAPSHOT artifacts that were not in the local maven
    // repository, the downloadAttachedNars
    // method above modified the version in the AttachedNarArtifact object to
    // set the timestamp version from
    // the web repository.
    // In order to unpack the files with the correct names we need to get back
    // the AttachedNarArtifact objects with
    // -SNAPSHOT versions, so we call again getAttachedNarArtifacts() to get the
    // unmodified AttachedNarArtifact
    // objects
    attachedNarArtifacts = getAttachedNarArtifacts(libraries);
    unpackAttachedNars(attachedNarArtifacts);

    // this may make some extra copies...
    for (final Object element : attachedNarArtifacts) {
      final Artifact dependency = (Artifact) element;
      getLog().debug("Assemble from " + dependency);

      // FIXME reported to maven developer list, isSnapshot
      // changes behaviour
      // of getBaseVersion, called in pathOf.
      dependency.isSnapshot();

      final File srcDir = getLayout().getNarUnpackDirectory(getUnpackDirectory(),
          getNarManager().getNarFile(dependency));
      // File srcDir = new File( getLocalRepository().pathOf( dependency ) );
      // srcDir = new File( getLocalRepository().getBasedir(),
      // srcDir.getParent() );
      // srcDir = new File( srcDir, "nar/" );

      final File dstDir = getTargetDirectory();
      try {
        FileUtils.mkdir(dstDir.getPath());
        getLog().debug("SrcDir: " + srcDir);
        if (srcDir.exists()) {
          FileUtils.copyDirectoryStructureIfModified(srcDir, dstDir);
        }
      } catch (final IOException ioe) {
        throw new MojoExecutionException("Failed to copy directory for dependency " + dependency + " from " + srcDir
            + " to " + dstDir, ioe);
      }
    }
  }
1181077
protected void setMapClass(Class mapClass)
    {
        //
        // If the provided map class is a ControlBean type, then locate associated control
        // interface or extension that defines properties.
        //
        if (ControlBean.class.isAssignableFrom(mapClass))
        {
            Class [] intfs = mapClass.getInterfaces();
            for (int i = 0; i < intfs.length; i++)
            {
                if (intfs[i].isAnnotationPresent(ControlInterface.class) ||
                    intfs[i].isAnnotationPresent(ControlExtension.class))
                {
                    mapClass = intfs[i];
                    break;
                }
            }
        }
        else
        {
            if (!mapClass.isAnnotation() &&
                !mapClass.isAnnotationPresent(ControlInterface.class) &&
                !mapClass.isAnnotationPresent(ControlExtension.class))
                throw new IllegalArgumentException(mapClass+" must be Control or annotation type");
        }

        _mapClass = mapClass;
    }
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 );
        }

    }
1194748
private void validate() throws MojoExecutionException {
		if ((file == null && libId == null) || (file != null && libId != null)) {
			getLog()
					.warn(
							"You specified <file> and <libId>.  The <libId> always wins.");
		}

		// check that COM target exists
		if (file != null && !file.exists()) {
			getLog().warn("Can't find file: " + file);
			throw new MojoExecutionException(
					"The native COM target file couldn't be found: " + file);
		}
	}
469851
@Override
    public void execute() throws MojoExecutionException {
        checkParameters();
        windowsModus = isWindows();
        if (windowsModus) {
            setWindowsVariables();
        } else {
            setLinuxVariables();
        }
        createDllFromWsdl();
    }
79826
public void executeMojo(MojoExecution mojo) throws MojoExecutionException, MojoFailureException {
		try {
			this.buildPluginManager.executeMojo(this.session, mojo);
		} catch (PluginConfigurationException
				| PluginManagerException e) {
			throw new MojoFailureException(e.getLocalizedMessage(), e);
		}
	}
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");
            }
        }
    }
1109501
protected void copyDependencies(String outputSubdirectory)
            throws MojoExecutionException {

        outputDirectory = project.getBuild().getDirectory();
        baseDirectory = project.getBasedir().getAbsolutePath();

        String outputDirectory = outputSubdirectory == null
                ? this.outputDirectory + "/dependency"
                : this.outputDirectory + "/" + outputSubdirectory;

        executeMojo(
                plugin(
                        groupId("org.apache.maven.plugins"),
                        artifactId("maven-dependency-plugin"),
                        version(MojoConstants.MAVEN_DEPENDENCY_PLUGIN_VERSION)
                ),
                goal("copy-dependencies"),
                configuration(
                        element("includeScope", "runtime"),
                        element("overWriteSnapshots", "true"),
                        element("excludeArtifactIds", "kumuluzee-loader"),
                        element("outputDirectory", outputDirectory)
                ),
                executionEnvironment(project, session, buildPluginManager)
        );

        copyOrCreateWebapp();
    }
344643
void createTotalSpecifications(final File dir, final String packageDirectory) throws MojoExecutionException {

        if (dir.equals(null)) {
            throw new MojoExecutionException("Could not read from directory " + dir.getPath());
        }
        final File[] files = dir.listFiles();
        if (files == null) {
            return;
        }
        final File[] providedContextFiles = dir.listFiles((java.io.FileFilter) FileFilterUtils.andFileFilter(FileFilterUtils.fileFileFilter(), FileFilterUtils.nameFileFilter("providedcontext.json")));
        if (providedContextFiles.length == 1) {
            final File parent = providedContextFiles[0].getParentFile();
            final File outputDir = new File(getSpecificationOutput() + File.separator + packageDirectory.substring(0,packageDirectory.lastIndexOf(File.separator)));
            outputDir.mkdirs();
            try {
                generateTotalSpecification(parent, outputDir);
            } catch (final CodeGenException e) {
                throw new MojoExecutionException("Couldn't create total specification",e);
            }
        }
        for (File entry : dir.listFiles()) {
            if (entry.isDirectory()) {
                createTotalSpecifications(entry, (packageDirectory == null) ? entry.getName() : packageDirectory + File.separator + entry.getName());
            }
        }
    }
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);
  }