<p>execute.</p>

@throws org.apache.tools.ant.BuildException if any.
511738
public void execute()
			throws BuildException
	{
		try
		{
			verboseHeaderToLog();

			List<String> args = buildCommandLine();

			verboseCommandLineToLog(args);

			doRun(args);

		}
        catch (BuildException ex) {
            throw ex;
        }
		catch (Exception ex)
		{
			throw new BuildException("AntTaskRunner", ex);
		}
	}
954179
@Override
    public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
        return true;
    }
138203
@Override
    public void execute() throws MojoExecutionException {
        try {
            // Work around for Application Insights Java SDK:
            // Sometimes, NoClassDefFoundError will be thrown even after Maven build is completed successfully.
            // An issue has been filed at https://github.com/Microsoft/ApplicationInsights-Java/issues/416
            // Before this issue is fixed, set default uncaught exception handler for all threads as work around.
            Thread.setDefaultUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());

            final Properties prop = new Properties();
            if (isFirstRun(prop)) {
                infoWithMultipleLines(PRIVACY_STATEMENT);
                updateConfigurationFile(prop);
            }

            if (isSkipMojo()) {
                info("Skip execution.");
                trackMojoSkip();
            } else {
                trackMojoStart();

                doExecute();

                trackMojoSuccess();
            }
        } catch (Exception e) {
            handleException(e);
        } finally {
            // When maven goal executes too quick, The HTTPClient of AI SDK may not fully initialized and will step
            // into endless loop when close, we need to call it in main thread.
            // Refer here for detail codes: https://github.com/Microsoft/ApplicationInsights-Java/blob/master/core/src
            // /main/java/com/microsoft/applicationinsights/internal/channel/common/ApacheSender43.java#L103
            try {
                // Sleep to wait ai sdk flush telemetries
                Thread.sleep(2 * 1000);
            } catch (InterruptedException e) {
                // swallow this exception
            }
            ApacheSenderFactory.INSTANCE.create().close();
        }
    }
1132715
@Override
  public void execute() throws BuildException {
    validate();

    String seedValue = Strings.emptyToNull(getProject().getProperty(propertyName)); 
    if (seedValue == null) {
      seedValue = SeedUtils.formatSeed(new Random().nextLong());
      log("Picking master seed for property '" + propertyName + "': "
          + seedValue, Project.MSG_VERBOSE);
      getProject().setProperty(propertyName, seedValue);
    } else {
      log("Seed property '" + propertyName + "' already defined: "
          + seedValue, Project.MSG_INFO);
    }
  }
197342
public void execute() {

    while (!steps.isEmpty()) {
      currentStep = steps.remove(0);

      try {
        LOG.debugPerformOperationStep(currentStep.getName());

        currentStep.performOperationStep(this);
        successfulSteps.add(currentStep);

        LOG.debugSuccessfullyPerformedOperationStep(currentStep.getName());
      }
      catch (Exception e) {

        if(isRollbackOnFailure) {

          try {
            rollbackOperation();
          }
          catch(Exception e2) {
            LOG.exceptionWhileRollingBackOperation(e2);
          }
          // re-throw the original exception
          throw LOG.exceptionWhilePerformingOperationStep(name, currentStep.getName(), e);
        }

        else {
          LOG.exceptionWhilePerformingOperationStep(currentStep.getName(), e);
        }

      }
    }

  }
812986
public void execute()
        throws MojoExecutionException
    {
        File jarFile = createArchive();

        String classifier = getClassifier();
        if ( classifier != null )
        {
            projectHelper.attachArtifact( getProject(), "jar", classifier, jarFile );
        }
        else
        {
            getProject().getArtifact().setFile( jarFile );
        }
    }
390579
@Override
   public void execute() throws BuildException 
   {
      if (getHome() == null)
         throw new BuildException("Home isn't set");

      try 
      {
         ProcessController pc = ProcessController.getInstance();
         int exitCode = pc.stop(getHome());

         if (exitCode != 0)
            throw new BuildException("IronJacamar instance exit code: " + exitCode);

         log("Stopped IronJacamar instance from: " + getHome());
      }
      catch (BuildException be) 
      {
         throw be;
      }
      catch (Throwable t) 
      {
         throw new BuildException(t.getMessage(), t);
      }
   }
1246264
@Override public void execute() throws BuildException {
    //
    //  At first it might seem appropriate to use the Project object from the calling Ant instance as the
    //  Project object used by the AntBuilder object and hence GantBuilder object associated with the Gant
    //  instance we are going to create here.  However, if we just use that Project object directly then
    //  there are problems with proper annotation of the lines of output, so it isn't really an option.
    //  Therefore create a new Project instance and set the things appropriately from the original Project
    //  object.
    //
    //  Issues driving things here are GANT-50 and GANT-80.  GANT-50 is about having the correct base
    //  directory for operations, GANT-80 is about ensuring that all output generation actually generated
    //  observable output.
    //
    //  NB As this class is called Gant, we have to use fully qualified name to get to the Gant main class.
    //
    final Project antProject =  getOwningTarget().getProject();
    final Project newProject = new Project();
    newProject.init();
    //  Deal with GANT-80 by getting all the the loggers from the Ant instance Project object and adding
    //  them to the new Project Object.  This was followed up by GANT-91 so the code was amended to copying
    //  over all listeners except the class loader if present.
    for (final Object o : antProject.getBuildListeners()) {
      final BuildListener listener = (BuildListener) o;
      if (!(listener instanceof AntClassLoader)) { newProject.addBuildListener(listener); }
    }
    //  Deal with GANT-50 by getting the base directory from the Ant instance Project object and use it for
    //  the new Project object.  GANT-93 leads to change in the way the Gant file is extracted.
    newProject.setBaseDir(antProject.getBaseDir());
    //  Deal with GANT-110 by using the strategy proposed by Eric Van Dewoestine.
    if (inheritAll) { addAlmostAll(newProject, antProject); }
    final File gantFile = newProject.resolveFile(file);
    if (! gantFile.exists()) { throw new BuildException("Gantfile does not exist.", getLocation()); }
    final GantBuilder ant = new GantBuilder(newProject);
    final Map<String,String> environmentParameter = new HashMap<String,String>();
    environmentParameter.put("environment", "environment");
    ant.invokeMethod("property", new Object[] { environmentParameter });
    final GantBinding binding = new GantBinding();
    binding.forcedSettingOfVariable("ant", ant);
    for (final Definition definition : definitions) {
      final Map<String,String> definitionParameter = new HashMap<String,String>();
      definitionParameter.put("name", definition.getName());
      definitionParameter.put("value", definition.getValue());
      ant.invokeMethod("property", new Object[] { definitionParameter });
    }
    final gant.Gant gant = new gant.Gant(binding);
    gant.loadScript(gantFile);
    final List<String> targetsAsStrings = new ArrayList<String>();
    for (final GantTarget g : targets) { targetsAsStrings.add(g.getValue()); }
    final int returnCode =  gant.processTargets(targetsAsStrings);
    if (returnCode != 0) { throw new BuildException("Gant execution failed with return code " + returnCode + '.', getLocation()); }
  }
745589
public void execute() throws BuildException {
    if (src == null && filesets.size()==0) {
      throw new BuildException("There must be a file attribute or a fileset child element");
    }
    if (src != null) {
      doCompile(src);
    }
    Project myProject = getProject();
    for (int i = 0; i < filesets.size(); i++) {
      FileSet fs = filesets.get(i);
      DirectoryScanner ds = fs.getDirectoryScanner(myProject);
      File dir = fs.getDir(myProject);
      String[] srcs = ds.getIncludedFiles();
      for (int j = 0; j < srcs.length; j++) {
        doCompile(new File(dir, srcs[j]));
      }
    }
  }
333099
@Override
    public void execute() throws ActivityException {
        Long instanceId = null;  // pre-existing instanceId
        String instanceIdSpec = getInstanceIdVariable();
        if (instanceIdSpec != null) {
            Object value = getValue(instanceIdSpec);
            if (value instanceof Long)
                instanceId = (Long) value;
            else if (value != null)
                instanceId = Long.parseLong(value.toString());
        }
        try {
            if (instanceId == null) {
                TaskInstance taskInstance = createTaskInstance();
                instanceId = taskInstance.getTaskInstanceId();
                if (instanceIdSpec != null)
                    setValue(instanceIdSpec, instanceId);
            }
            else {
                // update secondary owner
                updateOwningTransition(instanceId);
            }

            String taskInstCorrelationId = TaskAttributeConstant.TASK_CORRELATION_ID_PREFIX + instanceId;
            super.loginfo("Task instance created - ID " + instanceId);
            if (this.needSuspend()) {
                getEngine().createEventWaitInstance(
                        this.getActivityInstanceId(),
                        taskInstCorrelationId,
                        EventType.EVENTNAME_FINISH, true, true);
                EventWaitInstance received = registerWaitEvents(false,true);
                if (received!=null)
                        resume(getExternalEventInstanceDetails(received.getMessageDocumentId()),
                                         received.getCompletionCode());
            }
        } catch (Exception e) {
            throw new ActivityException(-1, e.getMessage(), e);
        }
    }
677002
public void execute() throws Exception {
        ActionRequest request = requestBuilder.request();

        //todo: maby change to instanceof multi?
        if(requestBuilder instanceof JoinRequestBuilder){
            executeJoinRequestAndSendResponse();
        }
		else if (request instanceof SearchRequest) {
			client.search((SearchRequest) request, new RestStatusToXContentListener<SearchResponse>(channel));
		} else if (requestBuilder instanceof SqlElasticDeleteByQueryRequestBuilder) {
            throw new UnsupportedOperationException("currently not support delete on elastic 2.0.0");
        }
        else if(request instanceof GetIndexRequest) {
            this.requestBuilder.getBuilder().execute( new GetIndexRequestRestListener(channel, (GetIndexRequest) request));
        }


		else {
			throw new Exception(String.format("Unsupported ActionRequest provided: %s", request.getClass().getName()));
		}
	}
730085
public void execute() throws BuildException
   {
      if (file == null)
         throw new BuildException("File not defined");

      if (!file.exists())
         throw new BuildException("File doesn't exists: " + file);

      try
      {
         Boolean result = null;
         if (isLocal())
         {
            Object value = executeCommand("local-undeploy", new Serializable[] {file.toURI().toURL()});

            if (value instanceof Boolean)
            {
               result = (Boolean)value;
            }
            else
            {
               throw (Throwable)value;
            }
         }
         else
         {
            Object value = executeCommand("remote-undeploy", new Serializable[] {file.getName()});

            if (value instanceof Boolean)
            {
               result = (Boolean)value;
            }
            else
            {
               throw (Throwable)value;
            }
         }

         if (result.booleanValue())
         {
            log("Undeployed: " + file.getName());
         }
         else
         {
            log(file.getName() + " wasn't undeployed");
         }
      }
      catch (Throwable t)
      {
         throw new BuildException("Unable to undeploy to " + getHost() + ":" + getPort() + " (" + t.getMessage() + ")",
                                  t);
      }
   }
520030
public void build(@NonNull ReportExecutor reportExecutor) {
        if (message == null && exception == null) {
            message = "Report requested by developer";
        }

        reportExecutor.execute(this);
    }
729200
@Override
    public void execute() throws BuildException {
        initialize();

        final Job job = getJob(tempDir, getProject());
        try {
            for (final ModuleElem m : modules) {
                m.setProject(getProject());
                m.setLocation(getLocation());
                final PipelineHashIO pipelineInput = new PipelineHashIO();
                for (final Map.Entry<String, String> e : attrs.entrySet()) {
                    pipelineInput.setAttribute(e.getKey(), e.getValue());
                }
                AbstractPipelineModule mod = getPipelineModule(m, pipelineInput);
                long start = System.currentTimeMillis();
                mod.setLogger(logger);
                mod.setJob(job);
                mod.execute(pipelineInput);
                long end = System.currentTimeMillis();
                logger.debug("{0} processing took {1} ms", mod.getClass().getSimpleName(), end - start);
            }
        } catch (final DITAOTException e) {
            throw new BuildException("Failed to run pipeline: " + e.getMessage(), e);
        }
    }
65425
@Override
    public void execute() {
        logger = new DITAOTAntLogger(getProject());
        logger.info(message);

        new Properties();
        //ensure tempdir is absolute
        if (!tempdir.isAbsolute()) {
            tempdir = new File(basedir, tempdir.getPath()).getAbsoluteFile();
        }
        //ensure outdir is absolute
        if (!outputdir.isAbsolute()) {
            outputdir = new File(basedir, outputdir.getPath()).getAbsoluteFile();
        }
        //ensure inputmap is absolute
        if (!new File(inputmap).isAbsolute()) {
            inputmap = new File(tempdir, inputmap).getAbsolutePath();
        }

        final Job job = getJob(tempdir, getProject());

        final LangParser parser = new LangParser();

        try {

            final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            final SAXParser saxParser = saxParserFactory.newSAXParser();
            //parse the user input file(usually a map)
            saxParser.parse(inputmap, parser);
            String langCode = parser.getLangCode();
            if (!StringUtils.isEmptyString(langCode)) {
                setActiveProjectProperty("htmlhelp.locale", langCode);
            } else {
                //parse topic files
                for (final FileInfo f: job.getFileInfo()) {
                    if (ATTR_FORMAT_VALUE_DITA.equals(f.format)) {
                        final File topicFile = new File(tempdir, f.file.getPath());
                        if (topicFile.exists()) {
                            saxParser.parse(topicFile, parser);
                            langCode = parser.getLangCode();
                            if (!StringUtils.isEmptyString(langCode)) {
                                setActiveProjectProperty("htmlhelp.locale", langCode);
                                break;
                            }
                        }
                    }
                }
                //no lang is set
                if (StringUtils.isEmptyString(langCode)) {
                    //use default lang code
                    setActiveProjectProperty("htmlhelp.locale", "en-us");
                }
            }



        } catch (final Exception e) {
            /* Since an exception is used to stop parsing when the search
             * is successful, catch the exception.
             */
            if (e.getMessage() != null &&
                    e.getMessage().equals("Search finished")) {
                System.out.println("Lang search finished");
            } else {
                e.printStackTrace();
            }
        }
    }
768669
@Override
    public void execute() throws BuildException {
        /*
         * A couple of the sample properties used in the download XML come from the Readme.html file and need the HTML elements stripped out before we can write the XML using the
         * supertype
         */
        String sampleName = null;
        String sampleAbstract = null;
        String readmeContent = null;

        // Parse the source readme file for the abstract, as it exists only in here
        try {
            Document doc = Jsoup.parse(sourceReadmeFile, "UTF-8");
            //Short abstract description is used by the tools (via download XML - "description"), and WASDev via wasdev.xml.
            Element abstractElement = getRequiredElementById(doc, "ibm-wasdev-sample-abstract-content");
            sampleAbstract = abstractElement.text();
            this.setDescription(abstractElement.text());

        } catch (IOException e) {
            // Can't read the readme so can't produce the XML
            throw new BuildException("Unable to load the Readme.html from " + sourceReadmeFile.getAbsolutePath() + " due to IOException: " + e.getMessage(), e);
        }

        // Parse the built readme file for everything else
        try {
            Document doc = Jsoup.parse(builtReadmeFile, "UTF-8");
            Element nameElement = getRequiredElementById(doc, "ibm-wasdev-sample-name-title");
            sampleName = nameElement.text();
            this.setName(sampleName);

            // Several nodes aren't needed for the WASDev page
            removeElementIfExistsById(doc, "ibm-wasdev-sample-name-title");
            removeElementIfExistsById(doc, "ibm-wasdev-sample-desc-title");
            removeElementIfExistsById(doc, "ibm-wasdev-sample-external-deps-title");
            removeElementIfExistsById(doc, "ibm-wasdev-sample-external-deps-content");
            removeElementIfExistsById(doc, "ibm-wasdev-sample-abstract-content");
            removeElementIfExistsById(doc, "ibm-title-support-info");
            removeElementIfExistsById(doc, "ibm-support-info");
            removeElementIfExistsById(doc, "ibmLicenseFlowing");

            Element readmeElement = getRequiredElementById(doc, "ibm-wasdev-sample-readme-content");

            // If the source is supplied append it to the description
            if (this.sourceFilePath != null) {
                File sourceFile = new File(this.sourceFilePath);
                if (sourceFile.exists()) {
                    BufferedReader br = null;
                    try {
                        br = new BufferedReader(new FileReader(sourceFile));
                        Element sourceNode = new Element(Tag.valueOf("code"), "");
                        String line = null;
                        while ((line = br.readLine()) != null) {
                            // Add nice spacing in the HTML, first tabs to spaces
                            line = line.replaceAll("\\t", "    ");
                            while (line.startsWith(" ")) {
                                line = line.substring(1);
                                sourceNode.append("&nbsp;");
                            }
                            sourceNode.appendText(line);
                            sourceNode.append("<br/>");
                        }
                        readmeElement.appendChild(sourceNode);
                    } finally {
                        if (br != null) {
                            br.close();
                        }
                    }
                }
            }
            readmeContent = readmeElement.html();
        } catch (IOException e) {
            // Can't read the readme so can't produce the XML
            throw new BuildException("Unable to load the Readme.html from " + builtReadmeFile.getAbsolutePath() + " due to IOException: " + e.getMessage(), e);
        }

        // All processing done (everything is set by ANT) so let the supertype generate the XML
        super.execute();

        // We also need to generate a properties file and a description.html with content used to populate Massive
        // First the properties file
        File propertiesFile = new File(this.propertiesFilePath);
        Properties assetInfoProps = new Properties();
        if (propertiesFile.exists()) {
            // Append to an existing props
            FileInputStream in = null;
            try {
                in = new FileInputStream(propertiesFile);
                assetInfoProps.load(in);
            } catch (FileNotFoundException e) {
                throw new BuildException(e);
            } catch (IOException e) {
                throw new BuildException(e);
            } finally {
                if (in != null) {
                    try {
                        in.close();
                    } catch (IOException e) {
                        throw new BuildException(e);
                    }
                }
            }
        }
        assetInfoProps.put("name", sampleName);
        assetInfoProps.put("shortDescription", sampleAbstract);
        assetInfoProps.put("downloadURL", assetDownloadUrl);
        FileOutputStream out = null;
        try {
            out = new FileOutputStream(propertiesFile);
            assetInfoProps.store(out, null);
        } catch (FileNotFoundException e) {
            throw new BuildException(e);
        } catch (IOException e) {
            throw new BuildException(e);
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (IOException e) {
                    throw new BuildException(e);
                }
            }
        }

        // In the same directory as the properties file, write the description.html file
        File descriptionFile = new File(propertiesFile.getParentFile(), "description.html");
        Writer descriptionWriter = null;
        try {
            descriptionWriter = new OutputStreamWriter(new FileOutputStream(descriptionFile), StandardCharsets.UTF_8);
            descriptionWriter.write(readmeContent);
        } catch (IOException e) {
            throw new BuildException(e);
        } finally {
            if (descriptionWriter != null) {
                try {
                    descriptionWriter.close();
                } catch (IOException e) {
                    throw new BuildException(e);
                }
            }
        }
    }
959030
@Override
    public void execute () throws BuildException
    {
        // make sure everything was set up properly
        ensureSet(_target, "Must specify the path to the target bundle " +
                  "file via the 'target' attribute.");
        ensureSet(_mapfile, "Must specify the path to the component map " +
                  "file via the 'mapfile' attribute.");
        ensureSet(_actionDef, "Must specify the action sequence " +
                  "definitions via the 'actiondef' attribute.");

        // enumerate all the dirs/files to be processed
        List<Tuple<File,List<String>>> sourceDirs = Lists.newArrayList();
        for (FileSet fs : _filesets) {
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            File fromDir = fs.getDir(getProject());
            String[] srcFiles = ds.getIncludedFiles();
            sourceDirs.add(Tuple.newTuple(fromDir, Arrays.asList(srcFiles)));
        }

        // do the deed!
        createBundler().execute(_root, _target, sourceDirs);
    }