org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo()方法的一些代码示例,展示了MojoExecutor.executeMojo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MojoExecutor.executeMojo()方法的具体详情如下:
包路径:org.twdata.maven.mojoexecutor.MojoExecutor
类名称:MojoExecutor
方法名:executeMojo

MojoExecutor.executeMojo介绍

[英]Entry point for executing a mojo
[中]执行魔咒的入口点

代码示例

代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin

/**
 * Executes the specified mojo, <i>using only the provided configuration</i>. Any configuration that has been
 * applied at the project level is <i>ignored</i>.
 *
 * @param plugin               the Maven plugin to execute
 * @param goal                 the goal (mojo) to execute
 * @param configuration        the <i>complete configuration</i> to apply
 * @param executionEnvironment the execution environment, providing access to the Maven project and session
 *                             and the plugin manager
 * @throws MojoExecutionException if executing the mojo fails
 */
public static void execute(Plugin plugin, String goal, Xpp3Dom configuration,
              MojoExecutor.ExecutionEnvironment executionEnvironment)
    throws MojoExecutionException {
  MojoExecutor.executeMojo(plugin, goal, configuration, executionEnvironment);
}

代码示例来源:origin: reactiverse/vertx-maven-plugin

/**
   * Execute the mojo.
   */
  public void execute() throws MojoExecutionException {
    executeMojo(
      plugin,
      goal,
      configuration,
      executionEnvironment(project, session, build)
    );
  }
}

代码示例来源:origin: bazaarvoice/emodb

private void stopCassandra() throws MojoExecutionException {
  getLog().info("Stopping cassandra...");
  executeMojo(CASSANDRA_PLUGIN,
      goal("stop"), cassandraStopConfiguration(),
      executionEnvironment(project, session, pluginManager)
  );
}

代码示例来源:origin: com.bazaarvoice.emodb/emodb-sdk

private void stopCassandra() throws MojoExecutionException {
  getLog().info("Stopping cassandra...");
  executeMojo(CASSANDRA_PLUGIN,
      goal("stop"), cassandraStopConfiguration(),
      executionEnvironment(project, session, pluginManager)
  );
}

代码示例来源:origin: org.twdata.maven/mojo-executor-maven-plugin

public void execute() throws MojoExecutionException {
  getLog().info("Executing with maven project " + mavenProject + " for session " + mavenSession);
  if ( quiet )
  {
    disableLogging();
  }
  executeMojo(plugin, goal, toXpp3Dom(configuration),
    (ignoreMavenProject ?
      executionEnvironment( mavenSession, pluginManager) :
      executionEnvironment( mavenProject, mavenSession, pluginManager)));
}

代码示例来源:origin: TimMoore/mojo-executor

public void execute() throws MojoExecutionException {
  getLog().info("Executing with maven project " + mavenProject + " for session " + mavenSession);
  if ( quiet )
  {
    disableLogging();
  }
  executeMojo(plugin, goal, toXpp3Dom(configuration),
    (ignoreMavenProject ?
      executionEnvironment( mavenSession, pluginManager) :
      executionEnvironment( mavenProject, mavenSession, pluginManager)));
}

代码示例来源:origin: ru.yandex.qatools.allure/allure-java-inject

protected void executeAspectJPluginWithGoal(String goal) throws MojoExecutionException {
  executeMojo(
      getAspectJPlugin(),
      goal(goal),
      getAspectJPluginConfiguration(),
      executionEnvironment(mavenProject, mavenSession, pluginManager)
  );
}

代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin

private void cleanupPluginFiles() throws MojoExecutionException {
  executeMojo(
      SDKConstants.getReleasePlugin(),
      goal("clean"),
      configuration(),
      executionEnvironment(mavenProject, mavenSession, pluginManager)
  );
}

代码示例来源:origin: com.bazaarvoice.emodb/emodb-sdk

private void startCassandra() throws MojoExecutionException {
  // find first available port and optimistically assume the subsequent ports are available.
  getLog().info("cassandraRpcPort = " + cassandraRpcPort);
  cassandraStopPort = cassandraRpcPort + 1;
  getLog().info("cassandraStopPort = " + cassandraStopPort);
  cassandraJmxPort = cassandraRpcPort + 2;
  getLog().info("cassandraJmxPort = " + cassandraJmxPort);
  cassandraStoragePort = cassandraRpcPort + 3;
  getLog().info("cassandraStoragePort = " + cassandraStoragePort);
  cassandraNativeTransportPort = cassandraRpcPort + 4;
  getLog().info("cassandraNativeTransportPort = " + cassandraNativeTransportPort);
  executeMojo(CASSANDRA_PLUGIN,
      goal("start"), cassandraStartConfiguration(),
      executionEnvironment(project, session, pluginManager)
  );
  CrossMojoState.putCassandraStopPort(cassandraStopPort, getPluginContext());
}

代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin

private void runMojoExecutor(List<MojoExecutor.Element> configuration, String goal) throws MojoExecutionException {
  executeMojo(
      plugin(
          groupId(FRONTEND_BUILDER_GROUP_ID),
          artifactId(FRONTEND_BUILDER_ARTIFACT_ID),
          version(FRONTEND_BUILDER_VERSION)
      ),
      goal(goal),
      configuration(configuration.toArray(new MojoExecutor.Element[0])),
      executionEnvironment(mavenProject, session, pluginManager)
  );
}

代码示例来源:origin: com.atlassian.maven.plugins/maven-amps-plugin

public void installIdeaPlugin() throws MojoExecutionException
{
  executeMojo(
      plugin(
          groupId("org.twdata.maven"),
          artifactId("maven-cli-plugin"),
          version(pluginArtifactIdToVersionMap.get("maven-cli-plugin"))
      ),
      goal("idea"),
      configuration(),
      executionEnvironment()
  );
}

代码示例来源:origin: com.atlassian.maven.plugins/maven-amps-plugin

public void executeAmpsRecursively(final String ampsVersion, final String ampsGoal, Xpp3Dom cfg) throws MojoExecutionException
{
  executeMojo(
    plugin(
      groupId("com.atlassian.maven.plugins"),
      artifactId("maven-amps-plugin"),
      version(ampsVersion)
    ),
    goal(ampsGoal),
    cfg,
    executionEnvironment());
}

代码示例来源:origin: nidi3/code-assert

private void report() throws MojoExecutionException {
  executeMojo(
      plugin(
          groupId("org.jacoco"),
          artifactId("jacoco-maven-plugin"),
          version(JACOCO_VERSION)
      ),
      goal("report"),
      configuration(),
      executionEnvironment(mavenProject, mavenSession, pluginManager)
  );
}

代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin

private void executeMojoPlugin(List<MojoExecutor.Element> artifactItems) throws MojoExecutionException {
  executeMojo(
      plugin(
          groupId(SDKConstants.PLUGIN_DEPENDENCIES_GROUP_ID),
          artifactId(SDKConstants.PLUGIN_DEPENDENCIES_ARTIFACT_ID),
          version(SDKConstants.PLUGIN_DEPENDENCIES_VERSION)
      ),
      goal("copy"),
      configuration(
          element(name("artifactItems"), artifactItems.toArray(new MojoExecutor.Element[0]))
      ),
      executionEnvironment(mavenProject, mavenSession, pluginManager)
  );
}

代码示例来源:origin: nidi3/code-assert

private void executeJacocoPlugin() throws MojoExecutionException {
  executeMojo(
      plugin(
          groupId("org.jacoco"),
          artifactId("jacoco-maven-plugin"),
          version(JACOCO_VERSION)
      ),
      goal("prepare-agent"),
      configuration(),
      executionEnvironment(mavenProject, mavenSession, pluginManager)
  );
}

代码示例来源:origin: nidi3/code-assert

private void runTest() throws MojoExecutionException {
  executeMojo(
      plugin(
          groupId("org.apache.maven.plugins"),
          artifactId("maven-surefire-plugin"),
          version("2.19.1")
      ),
      goal("test"),
      configuration(
          element("test", testClass),
          element("failIfNoTests", "false")
      ),
      executionEnvironment(mavenProject, mavenSession, pluginManager)
  );
}

代码示例来源:origin: allegro/grunt-maven-plugin

private void runExecutable(Executable executable) throws MojoExecutionException, MojoFailureException {
  Element[] configuration = buildConfigForOS(executable);
  if (executable.overrideSuccessCodes()) {
    Element customSuccessCodes = overwriteSuccessCodes(executable);
    configuration = concat(configuration, customSuccessCodes);
  }
  executeMojo(plugin(
      groupId(EXEC_MAVEN_GROUP),
      artifactId(EXEC_MAVEN_ARTIFACT),
      version(execMavenPluginVersion)),
      goal(EXEC_GOAL),
      configuration(configuration),
      pluginExecutionEnvironment());
}

代码示例来源:origin: allegro/grunt-maven-plugin

@Override
public void executeInternal() throws MojoExecutionException, MojoFailureException {
  executeMojo(plugin(
      groupId(RESOURCES_MAVEN_GROUP),
      artifactId(RESOURCES_MAVEN_ARTIFACT),
      version(mavenResourcesPluginVersion)),
      goal(RESOURCES_GOAL),
      configuration(
          element(name("overwrite"), Boolean.toString(overwriteResources)),
          element(name("outputDirectory"), gruntBuildDirectory),
          element(name("resources"), createResourceElements())
      ),
      pluginExecutionEnvironment());
  createWorkflowTasksDirectory();
  createInnerPropertiesResource();
}

代码示例来源:origin: allegro/grunt-maven-plugin

@Override
  public void executeInternal() throws MojoExecutionException, MojoFailureException {
    executeMojo(plugin(
        groupId(CLEAN_MAVEN_GROUP),
        artifactId(CLEAN_MAVEN_ARTIFACT),
        version(mavenCleanPluginVersion)),
        goal(CLEAN_GOAL),
        configuration(
            element(
                name("filesets"),
                element(name("fileset"),
                    element(name("directory"), gruntBuildDirectory))),
            element(name("excludeDefaultDirectories"), "true")),
        pluginExecutionEnvironment());
  }
}

代码示例来源:origin: net.orfjackal.retrolambda/retrolambda-maven-plugin

private void retrieveRetrolambdaJar(String version) throws MojoExecutionException {
  // TODO: use Maven's built-in artifact resolving, so that we can refer to retrolambda.jar in the local repository without copying it
  executeMojo(
      plugin(groupId("org.apache.maven.plugins"),
          artifactId("maven-dependency-plugin"),
          version("2.8")),
      goal("copy"),
      configuration(element("artifactItems",
          element("artifactItem",
              element(name("groupId"), "net.orfjackal.retrolambda"),
              element(name("artifactId"), "retrolambda"),
              element(name("version"), version),
              element(name("overWrite"), "true"),
              element(name("outputDirectory"), getRetrolambdaJarDir()),
              element(name("destFileName"), getRetrolambdaJarName())))),
      executionEnvironment(project, session, pluginManager));
}

相关文章