org.apache.maven.plugin.Mojo.execute()方法的使用及代码示例

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

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

Mojo.execute介绍

[英]Perform whatever build-process behavior this Mojo implements.
This is the main trigger for the Mojo inside the Maven system, and allows the Mojo to communicate errors.
[中]执行Mojo实现的任何构建过程行为。
这是Maven系统内Mojo的主要触发器,并允许Mojo通信错误。

代码示例

代码示例来源:origin: apache/maven

mojo.execute();

代码示例来源:origin: highsource/maven-jaxb2-plugin

public void testExecute() throws Exception {
  final Mojo mojo = initMojo();
  mojo.execute();
}

代码示例来源:origin: org.jvnet.jaxb2.maven2/maven-jaxb2-plugin-testing

public void testExecute() throws Exception {
  final Mojo mojo = initMojo();
  mojo.execute();
}

代码示例来源:origin: io.takari.maven.plugins/takari-plugin-testing

@Override
public Mojo executeMojo(MavenSession session, MavenProject project, MojoExecution execution) throws Exception {
 Mojo mojo = lookupConfiguredMojo(session, execution);
 mojo.execute();
 return mojo;
}

代码示例来源:origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

mojo.execute();

代码示例来源:origin: teamed/qulice

try {
  Logger.info(this, "Calling %s:%s...", coords, goal);
  mojo.execute();
} catch (final MojoExecutionException ex) {
  throw new IllegalArgumentException(ex);

代码示例来源:origin: zanata/zanata-platform

protected void applyPomParams(String pomFile) throws Exception {
    URL resource = Thread.currentThread().getContextClassLoader()
        .getResource("push-test/" + pomFile);
    File testPom = new File(resource.toURI());
    // This will work with "mvn test", but not with Eclipse's JUnit runner:
    // PushSimpleMojo mojo = (PushSimpleMojo) lookupMojo("push", testPom);
    // assertNotNull(mojo);
    getMockCommand().runWithActions();
    EasyMock.expectLastCall();
    control.replay();
    configureMojo(getMojo(), "zanata-maven-plugin", testPom);
    getMojo().execute();
    control.verify();
  }
}

代码示例来源:origin: io.takari.maven.plugins/takari-plugin-testing

@Override
public Mojo executeMojo(MavenSession session, MavenProject project, MojoExecution execution) throws Exception {
 Object sessionScope = container.lookup("org.apache.maven.SessionScope");
 try {
  enter(sessionScope);
  seed(sessionScope, MavenSession.class, session);
  MojoExecutionScope executionScope = container.lookup(MojoExecutionScope.class);
  try {
   executionScope.enter();
   executionScope.seed(MavenProject.class, project);
   executionScope.seed(MojoExecution.class, execution);
   Mojo mojo = lookupConfiguredMojo(session, execution);
   mojo.execute();
   MojoExecutionEvent event = new MojoExecutionEvent(session, project, execution, mojo);
   for (MojoExecutionListener listener : container.lookupList(MojoExecutionListener.class)) {
    listener.afterMojoExecutionSuccess(event);
   }
   return mojo;
  } finally {
   executionScope.exit();
  }
 } finally {
  exit(sessionScope);
 }
}

代码示例来源:origin: io.takari.maven.plugins/takari-plugin-testing

@Override
public Mojo executeMojo(MavenSession session, MavenProject project, MojoExecution execution) throws Exception {
 SessionScope sessionScope = container.lookup(SessionScope.class);
 try {
  sessionScope.enter();
  sessionScope.seed(MavenSession.class, session);
  MojoExecutionScope executionScope = container.lookup(MojoExecutionScope.class);
  try {
   executionScope.enter();
   executionScope.seed(MavenProject.class, project);
   executionScope.seed(MojoExecution.class, execution);
   Mojo mojo = lookupConfiguredMojo(session, execution);
   mojo.execute();
   MojoExecutionEvent event = new MojoExecutionEvent(session, project, execution, mojo);
   for (MojoExecutionListener listener : container.lookupList(MojoExecutionListener.class)) {
    listener.afterMojoExecutionSuccess(event);
   }
   return mojo;
  } finally {
   executionScope.exit();
  }
 } finally {
  sessionScope.exit();
 }
}

相关文章