Bundle project as a Mac OS X application bundle.

@throws MojoExecutionException If an unexpected error occurs during
packaging of the bundle.
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");
    }
468739
@Override
    public void execute()
    {
        if ( "pom".equals( project.getPackaging() ) )
        {
            getLog().info( "Skipping SCoverage execution for project with packaging type 'pom'" );
            return;
        }

        if ( skip )
        {
            getLog().info( "Skipping Scoverage execution" );
            return;
        }

        long ts = System.currentTimeMillis();

        SCoverageForkedLifecycleConfigurator.afterForkedLifecycleExit( project, reactorProjects );

        long te = System.currentTimeMillis();
        getLog().debug( String.format( "Mojo execution time: %d ms", te - ts ) );
    }
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);
        }
    }
1350773
@Override
    public void execute() throws MojoExecutionException
    {
        if ( "pom".equals( project.getPackaging() ) )
        {
            getLog().info( "Skipping SCoverage execution for project with packaging type 'pom'" );
            //for aggragetor mojo - list of submodules: List<MavenProject> modules = project.getCollectedProjects();
            return;
        }

        if ( skip )
        {
            getLog().info( "Skipping Scoverage execution" );

            Properties projectProperties = project.getProperties();

            // for maven-resources-plugin (testResources), maven-compiler-plugin (testCompile),
            // sbt-compiler-maven-plugin (testCompile), scala-maven-plugin (testCompile),
            // maven-surefire-plugin and scalatest-maven-plugin
            setProperty( projectProperties, "maven.test.skip", "true" );
            // for scalatest-maven-plugin and specs2-maven-plugin
            setProperty( projectProperties, "skipTests", "true" );

            return;
        }

        long ts = System.currentTimeMillis();

        String scalaBinaryVersion = null;
        String resolvedScalaVersion = resolveScalaVersion();
        if ( resolvedScalaVersion != null )
        {
            if ( "2.10".equals( resolvedScalaVersion ) || resolvedScalaVersion.startsWith( "2.10." ) )
            {
                scalaBinaryVersion = "2.10";
            }
            else if ( "2.11".equals( resolvedScalaVersion ) || resolvedScalaVersion.startsWith( "2.11." ) )
            {
                scalaBinaryVersion = "2.11";
            }
            else if ( "2.12".equals( resolvedScalaVersion ) || resolvedScalaVersion.startsWith( "2.12." ) )
            {
                scalaBinaryVersion = "2.12";
            }
            else if ( "2.13.0-RC1".equals( resolvedScalaVersion ) )
            {
                scalaBinaryVersion = "2.13.0-RC1";
            }
            else
            {
                getLog().warn( String.format( "Skipping SCoverage execution - unsupported Scala version \"%s\"",
                                              resolvedScalaVersion ) );
                return;
            }
        }
        else
        {
            getLog().warn( "Skipping SCoverage execution - Scala version not set" );
            return;
        }

        Map<String, String> additionalProjectPropertiesMap = null;
        if ( additionalForkedProjectProperties != null && !additionalForkedProjectProperties.isEmpty() )
        {
            String[] props = additionalForkedProjectProperties.split( ";" );
            additionalProjectPropertiesMap = new HashMap<String, String>( props.length );
            for ( String propVal: props )
            {
                String[] tmp = propVal.split( "=", 2 );
                if ( tmp.length == 2 )
                {
                    String propName = tmp[ 0 ].trim();
                    String propValue = tmp[ 1 ].trim();
                    additionalProjectPropertiesMap.put( propName, propValue );
                }
                else
                {
                    getLog().warn( String.format( "Skipping invalid additional forked project property \"%s\", must be in \"key=value\" format",
                            propVal ) );

                }
            }
        }

        SCoverageForkedLifecycleConfigurator.afterForkedLifecycleEnter( project, reactorProjects, additionalProjectPropertiesMap );

        try
        {
            Artifact pluginArtifact = getScalaScoveragePluginArtifact( scalaBinaryVersion );
            Artifact runtimeArtifact = getScalaScoverageRuntimeArtifact( scalaBinaryVersion );

            if ( pluginArtifact == null )
            {
                return; // scoverage plugin will not be configured
            }

            addScoverageDependenciesToClasspath( runtimeArtifact );

            String arg = DATA_DIR_OPTION + dataDirectory.getAbsolutePath();
            String _scalacOptions = quoteArgument( arg );
            String addScalacArgs = arg;

            if ( !StringUtils.isEmpty( excludedPackages ) )
            {
                arg = EXCLUDED_PACKAGES_OPTION + excludedPackages.replace( "(empty)", "<empty>" );
                _scalacOptions = _scalacOptions + SPACE + quoteArgument( arg );
                addScalacArgs = addScalacArgs + PIPE + arg;
            }

            if ( !StringUtils.isEmpty( excludedFiles ) )
            {
                arg = EXCLUDED_FILES_OPTION + excludedFiles;
                _scalacOptions = _scalacOptions + SPACE + quoteArgument( arg );
                addScalacArgs = addScalacArgs + PIPE + arg;
            }

            if ( highlighting )
            {
                _scalacOptions = _scalacOptions + SPACE + "-Yrangepos";
                addScalacArgs = addScalacArgs + PIPE + "-Yrangepos";
            }

            String _scalacPlugins =
                String.format( "%s:%s:%s", pluginArtifact.getGroupId(), pluginArtifact.getArtifactId(),
                               pluginArtifact.getVersion() );

            arg = PLUGIN_OPTION + pluginArtifact.getFile().getAbsolutePath();
            addScalacArgs = addScalacArgs + PIPE + arg;

            Properties projectProperties = project.getProperties();

            // for sbt-compiler-maven-plugin (version 1.0.0-beta5+)
            setProperty( projectProperties, "sbt._scalacOptions", _scalacOptions );
            // for sbt-compiler-maven-plugin (version 1.0.0-beta5+)
            setProperty( projectProperties, "sbt._scalacPlugins", _scalacPlugins );
            // for scala-maven-plugin (version 3.0.0+)
            setProperty( projectProperties, "addScalacArgs", addScalacArgs );
            // for scala-maven-plugin (version 3.1.0+)
            setProperty( projectProperties, "analysisCacheFile",
                         "${project.build.directory}/scoverage-analysis/compile" );
            // for maven-surefire-plugin and scalatest-maven-plugin
            setProperty( projectProperties, "maven.test.failure.ignore", "true" );

            // for maven-jar-plugin
            // VERY IMPORTANT! Prevents from overwriting regular project artifact file
            // with instrumented one during "integration-check" or "integration-report" execution.
            project.getBuild().setFinalName( "scoverage-" + project.getBuild().getFinalName() );

            saveSourceRootsToFile();
        }
        catch ( ArtifactNotFoundException e )
        {
            throw new MojoExecutionException( "SCoverage preparation failed", e );
        }
        catch ( ArtifactResolutionException e )
        {
            throw new MojoExecutionException( "SCoverage preparation failed", e );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "SCoverage preparation failed", e );
        }

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

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

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

                JarFile jarFile = new JarFile(jar);

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

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

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

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

                if (!foundPom) {
                    getLog().info("pom.xml not found in " + jar.getName());
                }
            } catch (IOException e) {
                getLog().warn("This jar file was not packaged by Maven");
            }
        }
        // if packaging is set, check it
        if (packaging != null & !"jar".equals(packaging)) {
            throw new MojoExecutionException("POM packaging is not 'jar' ");
        }
        
        if (!jar.getName().endsWith(".jar")) {
            throw new MojoExecutionException("Jar File extension must be 'jar'  ");
        }
    
        if (groupId == null || "".equals(groupId)) {
            throw new MojoExecutionException("Group Id is empty  ");
        }
  
        if (artifactId == null || "".equals(artifactId)) {
            throw new MojoExecutionException("Artifact Id is empty  ");
        }
 
        if (version == null || "".equals(version)) {
            throw new MojoExecutionException("Version is empty  ");
        }
        
        installJar(jar);
    }
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;
                }
            }
        }
    }
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);
        }
    }
534168
public static Bundle installBundle(BundleContext context, Resource bundle, boolean checkExistence) throws IOException, BundleException {
	if (checkExistence) {
	    BundleFile bf = new BundleFile(bundle);
	    if (!bf.isBundle()) throw new BundleException(bundle + " is not a valid bundle!");

	    Bundle existing = loadBundleFromLocal(context, bf.getSymbolicName(), bf.getVersion(), false, null);
	    if (existing != null) return existing;
	}

	return _loadBundle(context, bundle.getAbsolutePath(), bundle.getInputStream(), true);
    }
895399
public void run(T configuration, Environment environment) throws Exception {
        for (ConfiguredBundle<? super T> bundle : configuredBundles) {
            bundle.run(configuration, environment);
        }
    }
1174988
private void addProjectProperties() throws MojoExecutionException
    {
        Properties projectProps = mavenProject.getProperties();
        
        projectProps.setProperty( PROPERTY_NAME_COMPANY, versionInfo.getCompanyName() );
        projectProps.setProperty( PROPERTY_NAME_COPYRIGHT, versionInfo.getCopyright() );

        projectProps.setProperty( PROPERTY_NAME_VERSION_MAJOR, "0" );
        projectProps.setProperty( PROPERTY_NAME_VERSION_MINOR, "0" );
        projectProps.setProperty( PROPERTY_NAME_VERSION_INCREMENTAL, "0" );
        projectProps.setProperty( PROPERTY_NAME_VERSION_BUILD, "0" );
        String version = mavenProject.getVersion();
        if ( version != null && version.length() > 0 )
        {
            ArtifactVersion artifactVersion = new DefaultArtifactVersion( version );
            if ( version.equals( artifactVersion.getQualifier() ) )
            {
                String msg = "Unable to parse the version string, please use standard maven version format.";
                getLog().error( msg );
                throw new MojoExecutionException( msg );
            }
            projectProps.setProperty( PROPERTY_NAME_VERSION_MAJOR, 
                    String.valueOf( artifactVersion.getMajorVersion() ) );
            projectProps.setProperty( PROPERTY_NAME_VERSION_MINOR, 
                    String.valueOf( artifactVersion.getMinorVersion() ) );
            projectProps.setProperty( PROPERTY_NAME_VERSION_INCREMENTAL, 
                    String.valueOf( artifactVersion.getIncrementalVersion() ) );
            projectProps.setProperty( PROPERTY_NAME_VERSION_BUILD, 
                    String.valueOf( artifactVersion.getBuildNumber() ) );
        }
        else
        {
            getLog().warn( "Missing version for project. Version parts will be set to 0" );
        }
    }
273194
private void nugetPackCommand() throws MojoExecutionException {
        List<String> commandList = new LinkedList<String>();
        commandList.add(0, NUGET_COMMAND);
        commandList.add(1, "pack");
        String[] command = commandList.toArray(new String[commandList.size()]);
        ProcessBuilder builder = new ProcessBuilder();
        builder.redirectErrorStream(true);
        builder.directory(new File(nugetFolder));
        builder.command(command);
        try {
            executeACommand(builder.start());
        } catch (InterruptedException | IOException e) {
            throw new MojoExecutionException("Error, while executing command: "
                    + Arrays.toString(command) + "\n", e);
        }
    }
639143
public void start(BundleContext context)
            throws Exception
    {
        String library = System.mapLibraryName(LIBRARY_NAME);
        if (library.toLowerCase().endsWith(".dylib")) {
            // some MacOS JDK7+ vendors map to dylib instead of jnilib
            library = library.replace(".dylib", ".jnilib");
        }
        System.loadLibrary(library);
        SnappyLoader.setSnappyApi(new SnappyNative());
    }
1320820
public void execute() throws MojoExecutionException {

		getLog().debug("- outputDirectory : " + outputDirectory);
		// security
		try {
			CheckService.isValidOutputDirectory(outputDirectory);
		} catch (InvalidOutputDirectoryException e) {
			throw new MojoExecutionException("CheckService return error(s)", e);
		}

		getLog().debug("- resources : " + resources);
		for (Resource resource : resources) {

			try {
				ResourceService.execute(this, resource, outputDirectory);
			} catch (ResourceExecutionException e) {
				throw new MojoExecutionException(
						"ResourceService return error(s)", e);
			}
		}

	}
548133
public void execute() throws MojoExecutionException, MojoFailureException {
        getLog().info("Downloading fabric8 maven artifacts to local repository: " + localRepositoryDirectory);

        File repo = init();

        // find the fabric8 artifact
        Artifact artifact = findFabric8Archetype(project);

        if (artifact != null) {
            ArchetypeCatalog catalog;
            try {
                catalog = FabricArchetypeCatalogFactory.getArchetypeCatalog(artifact);
            } catch (Exception e) {
                getLog().warn("Error downloading archetype catalog due " + e.getMessage(), e);
                return;
            }

            if (catalog != null) {
                getLog().info("Catalog contains " + catalog.getArchetypes().size() + " archetypes");

                for (Archetype a : catalog.getArchetypes()) {
                    try {
                        download(repo, a);
                    } catch (Exception e) {
                        getLog().warn("Error downloading " + a + " due " + e.getMessage(), e);
                    }
                }
            }
        }

        getLog().info("Download complete");
    }
543353
protected void buildShareWar() throws MojoExecutionException {
        buildCustomWarInDir(SHARE_WAR_PREFIX_NAME, shareModules,
                alfrescoGroupId, alfrescoShareWarArtifactId, alfrescoShareVersion);

        copyShareLog4jConfig();
        copyShareConfigCustom();
        copyHotswapAgentProperties(SHARE_WAR_PREFIX_NAME);


        String shareWarArtifactId = packageAndInstallCustomWar(SHARE_WAR_PREFIX_NAME);

        // Set up the custom share war to be run by Tomcat plugin
        runnerAlfrescoGroupId = "${project.groupId}";
        runnerAlfrescoShareWarArtifactId = shareWarArtifactId;
        runnerAlfrescoShareVersion = "${project.version}";
    }
385480
public void run() throws MojoExecutionException {
    try {
      runMojo
          .getAppEngineFactory()
          .devServerRunSync()
          .run(configBuilder.buildRunConfiguration(processServices(), processProjectId()));
    } catch (AppEngineException ex) {
      throw new MojoExecutionException("Failed to run devappserver", ex);
    }
  }
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());
            }
        }
    }