org.apache.maven.plugins.annotations.Mojo类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(188)

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

Mojo介绍

暂无

代码示例

代码示例来源:origin: jooby-project/jooby

@Mojo(name = "apitool", requiresDependencyResolution = ResolutionScope.COMPILE,
  defaultPhase = LifecyclePhase.PREPARE_PACKAGE)
public class ApiToolMojo extends AbstractMojo {
 @Component
 private MavenProject mavenProject;
 @Parameter(property = "main.class", defaultValue = "${application.class}")
 protected String mainClass;

代码示例来源:origin: jooby-project/jooby

@Mojo(name = "assets", defaultPhase = LifecyclePhase.PREPARE_PACKAGE,
  requiresDependencyResolution = ResolutionScope.COMPILE)
@Execute(phase = LifecyclePhase.PREPARE_PACKAGE)
public class AssetMojo extends AbstractMojo {
 @Component
 private MavenProject mavenProject;
 @Parameter(property = "main.class", defaultValue = "${application.class}")
 protected String mainClass;
 @Parameter(defaultValue = "${project.build.outputDirectory}")
 private File output;
 @Parameter(defaultValue = "${project.build.directory}${file.separator}__public_")
 private File assemblyOutput;

代码示例来源:origin: vipshop/Saturn

@Mojo(name = "run", requiresDependencyResolution = ResolutionScope.RUNTIME)
@Execute(phase = LifecyclePhase.COMPILE)
public class SaturnJobRunMojo extends AbstractMojo {
  @Parameter(property = "namespace")
  private String namespace;
  @Parameter(property = "executorName")
  private String executorName;

代码示例来源:origin: eirslett/frontend-maven-plugin

@Mojo(name="jspm",  defaultPhase = LifecyclePhase.GENERATE_RESOURCES)
public class JspmMojo extends AbstractFrontendMojo {

  /**
   * JSPM arguments. Default is "install".
   */
  @Parameter(defaultValue = "install", property = "frontend.bower.arguments", required = false)
  private String arguments;

  /**
   * Skips execution of this mojo.
   */
  @Parameter(property = "skip.jspm", defaultValue = "${skip.jspm}")
  private boolean skip;

  @Override
  protected boolean skipExecution() {
    return this.skip;
  }

  @Override
  protected void execute(FrontendPluginFactory factory) throws TaskRunnerException {
    factory.getJspmRunner().execute(arguments, environmentVariables);
  }

}

代码示例来源:origin: electronicarts/ea-async

@Mojo(name = "instrument",
    defaultPhase = LifecyclePhase.PROCESS_CLASSES,
    requiresProject = false,
    threadSafe = true,
    requiresDependencyResolution = ResolutionScope.RUNTIME)
@Execute(goal = "instrument", phase = LifecyclePhase.PROCESS_CLASSES)
public class MainMojo extends AbstractAsyncMojo

代码示例来源:origin: bytedeco/javacpp

/**
 * A {@link BuildMojo} that always forces {@link BuildMojo#generate} to false,
 * with the goal of parsing header files instead.
 *
 * @author Samuel Audet
 */
@Mojo(name = "parse", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
public class ParseMojo extends BuildMojo {
  @Override public void execute() throws MojoExecutionException {
    generate = false;
    super.execute();
  }
}

代码示例来源:origin: vipshop/Saturn

@Mojo(name = "zip", requiresDependencyResolution = ResolutionScope.RUNTIME)
@Execute(phase = LifecyclePhase.PACKAGE)
public class SaturnJobZipMojo extends AbstractMojo {
  @Component
  private MavenProjectHelper projectHelper;

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

@Mojo( name = "setup" )
public class SetupMojo extends MainMojo {
  @Component
  private MavenProjectHelper projectHelper;

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

descriptor.setGoal(mojo.name());
descriptor.setExecutionStrategy(mojo.executionStrategy());
descriptor.setRequiresProject(mojo.requiresProject());
descriptor.setRequiresReports(mojo.requiresReports());
descriptor.setAggregator(mojo.aggregator());
descriptor.setRequiresDirectInvocation(mojo.requiresDirectInvocation());
descriptor.setRequiresOnline(mojo.requiresOnline());
descriptor.setInheritedByDefault(mojo.inheritByDefault());
if (!isEmpty(mojo.configurator())) {
 descriptor.setConfigurator(mojo.configurator());
descriptor.setThreadSafe(mojo.threadSafe());
descriptor.setPhase(mojo.defaultPhase().id());
descriptor.setRequiresDependencyResolution(mojo.requiresDependencyResolution().id());
descriptor.setRequiresDependencyCollection(mojo.requiresDependencyCollection().id());
descriptor.setInstantiationStrategy(mojo.instantiationStrategy().id());

代码示例来源:origin: org.apache.maven.plugin-tools/maven-plugin-tools-annotations

assertEquals( "foo", mojo.name() );
assertEquals( true, mojo.threadSafe() );
assertEquals( false, mojo.aggregator() );
assertEquals( LifecyclePhase.COMPILE, mojo.defaultPhase() );
assertEquals( "compiler", execute.goal() );
assertEquals( "my-lifecycle", execute.lifecycle() );
assertEquals( LifecyclePhase.PACKAGE, execute.phase() );

代码示例来源:origin: jooby-project/jooby

@Mojo(name = "run", threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase = LifecyclePhase.TEST_COMPILE)
public class JoobyMojo extends AbstractMojo {
 private static final Object LOCK = new Object();
 @Parameter(defaultValue = "${project}", required = true, readonly = true)
 private MavenProject mavenProject;
 @Parameter(defaultValue = "${session}", required = true, readonly = true)
 protected MavenSession session;
 @Parameter(property = "main.class", defaultValue = "${application.class}")
 protected String mainClass;
 private String compiler;
 @Component
 protected Maven maven;

代码示例来源:origin: electronicarts/ea-async

@Mojo(name = "instrument-test",
    defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES,
    requiresProject = false,
    requiresDirectInvocation = false,
    requiresDependencyResolution = ResolutionScope.TEST)
@Execute(goal = "instrument-test", phase = LifecyclePhase.PROCESS_TEST_CLASSES)
public class TestMojo extends AbstractAsyncMojo
  @Parameter(property = "maven.test.skip")
  private boolean skip;
  @Parameter(defaultValue = "${project.build.testOutputDirectory}", required = true)
  private File testClassesDirectory;

代码示例来源:origin: eirslett/frontend-maven-plugin

@Mojo(name="karma",  defaultPhase = LifecyclePhase.TEST)
public final class KarmaRunMojo extends AbstractFrontendMojo {

  /**
   * Path to your karma configuration file, relative to the working directory (default is "karma.conf.js")
   */
  @Parameter(defaultValue = "karma.conf.js", property = "karmaConfPath")
  private String karmaConfPath;

  /**
   * Skips execution of this mojo.
   */
  @Parameter(property = "skip.karma", defaultValue = "${skip.karma}")
  private boolean skip;

  @Override
  protected boolean skipExecution() {
    return this.skip;
  }

  @Override
  public void execute(FrontendPluginFactory factory) throws TaskRunnerException {
    factory.getKarmaRunner().execute("start " + karmaConfPath, environmentVariables);
  }
}

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

@Mojo(name = "run", requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase = LifecyclePhase.PACKAGE)
public class CrowdRunMojo extends RunMojo
{
  @Override
  protected String getDefaultProductId() throws MojoExecutionException
  {
    return ProductHandlerFactory.CROWD;
  }
}

代码示例来源:origin: speedment/speedment

/**
 * A Maven goal that modifies entries in the {@code speedment.json}-file.
 *
 * @author Emil Forslund
 * @since  3.1.4
 */
@Mojo(name = "edit",
  defaultPhase = LifecyclePhase.INITIALIZE,
  requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME
)
public class EditMojo extends AbstractEditMojo {}

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

@Mojo( name = "runner", requiresDependencyResolution = ResolutionScope.TEST,
    requiresDependencyCollection = ResolutionScope.TEST )
public class RunnerMojo extends MainMojo {
  @Component
  private MavenProjectHelper projectHelper;

代码示例来源:origin: takari/takari-lifecycle

descriptor.setGoal(mojo.name());
descriptor.setExecutionStrategy(mojo.executionStrategy());
descriptor.setRequiresProject(mojo.requiresProject());
descriptor.setRequiresReports(mojo.requiresReports());
descriptor.setAggregator(mojo.aggregator());
descriptor.setRequiresDirectInvocation(mojo.requiresDirectInvocation());
descriptor.setRequiresOnline(mojo.requiresOnline());
descriptor.setInheritedByDefault(mojo.inheritByDefault());
if (!isEmpty(mojo.configurator())) {
 descriptor.setConfigurator(mojo.configurator());
descriptor.setThreadSafe(mojo.threadSafe());
descriptor.setPhase(mojo.defaultPhase().id());
descriptor.setRequiresDependencyResolution(mojo.requiresDependencyResolution().id());
descriptor.setRequiresDependencyCollection(mojo.requiresDependencyCollection().id());
descriptor.setInstantiationStrategy(mojo.instantiationStrategy().id());

代码示例来源:origin: eirslett/frontend-maven-plugin

@Mojo(name = "bower", defaultPhase = LifecyclePhase.GENERATE_RESOURCES)
public final class BowerMojo extends AbstractFrontendMojo {
  @Parameter(defaultValue = "install", property = "frontend.bower.arguments", required = false)
  private String arguments;
  @Parameter(property = "skip.bower", defaultValue = "${skip.bower}")
  private boolean skip;
  @Parameter(property = "session", defaultValue = "${session}", readonly = true)
  private MavenSession session;
  private boolean bowerInheritsProxyConfigFromMaven;
  @Component(role = SettingsDecrypter.class)
  private SettingsDecrypter decrypter;

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

@Mojo (
  name = "generate-resources",
  defaultPhase = LifecyclePhase.GENERATE_RESOURCES
@Execute (
  goal = "generate-resources",
  phase = LifecyclePhase.GENERATE_RESOURCES
 @Component
 private MavenProject project;
 @Parameter( defaultValue = "${project.basedir}", readonly = true )
 private File basedir;
 @Parameter( defaultValue = "src/main/jsonschema", readonly = true ) // Maven 3 only
 public String sourceDirectory;
 @Parameter( readonly = true ) // Maven 3 only
 public List<String> sourcePaths;

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

/**
 * Runs the plugin via the plugins 3 container.
 *
 * <strong>This is an experimental goal and may be removed in future versions</strong>
 */
@Mojo(name = "debug-container")
@Execute(phase = LifecyclePhase.PACKAGE)
public class DebugContainerMojo extends AbstractProductAwareMojo
{
  @Parameter(property = "container.version", defaultValue = "LATEST")
  private String containerVersion;

  public void execute() throws MojoExecutionException, MojoFailureException
  {
    MavenProject project = getMavenContext().getProject();
    File pluginFile = new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + ".jar");

    getMavenGoals().copyContainerToOutputDirectory(containerVersion);

    getMavenGoals().debugStandaloneContainer(pluginFile);
  }
}

相关文章