Class QuarkusBootstrapMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.quarkus.maven.QuarkusBootstrapMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
BuildMojo, GenerateCodeMojo, NativeImageAgentMojo, RunMojo, TrackConfigChangesMojo

public abstract class QuarkusBootstrapMojo extends org.apache.maven.plugin.AbstractMojo
  • Field Details

    • BOOTSTRAP_ID_PARAM

      static final String BOOTSTRAP_ID_PARAM
      See Also:
    • CLOSE_BOOTSTRAPPED_APP_PARAM

      static final String CLOSE_BOOTSTRAPPED_APP_PARAM
      See Also:
    • MODE_PARAM

      static final String MODE_PARAM
      See Also:
    • RELOAD_POMS_PARAM

      static final String RELOAD_POMS_PARAM
      See Also:
    • NATIVE_PROFILE_NAME

      static final String NATIVE_PROFILE_NAME
      See Also:
    • bootstrapProvider

      @Component protected QuarkusBootstrapProvider bootstrapProvider
    • mojoExecution

      @Parameter(defaultValue="${mojoExecution}", readonly=true, required=true) org.apache.maven.plugin.MojoExecution mojoExecution
      The context of the execution of the plugin.
    • bootstrapId

      @Parameter(required=false) String bootstrapId
      Application bootstrap provider ID. This parameter is not supposed to be configured by the user. To be able to re-use an application bootstrapped in one phase in a later phase, there needs to be a way to identify the correct instance of the bootstrapped application (in case there are more than one) in each Mojo. A bootstrap ID serves this purpose. This parameter is set in DevMojo invoking generate-code and generate-code-tests goals. If this parameter is not configured, a Mojo execution ID will be used as the bootstrap ID.
    • closeBootstrappedApp

      @Parameter(property="quarkusCloseBootstrappedApp") Boolean closeBootstrappedApp
      Whether to close the bootstrapped applications after the execution
    • reloadPoms

      @Parameter(property="reloadPoms") Set<File> reloadPoms
      POM files from the workspace that should be reloaded from the disk instead of taken from the Maven reactor. This parameter is not supposed to be configured by a user.
  • Constructor Details

    • QuarkusBootstrapMojo

      public QuarkusBootstrapMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • setLog

      public void setLog(org.apache.maven.plugin.logging.Log log)
      Specified by:
      setLog in interface org.apache.maven.plugin.Mojo
      Overrides:
      setLog in class org.apache.maven.plugin.AbstractMojo
    • beforeExecute

      protected abstract boolean beforeExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      This callback allows to evaluate whether this mojo should be executed, skipped or fail.
      Returns:
      false if the execution of the mojo should be skipped, true if the mojo should be executed
      Throws:
      org.apache.maven.plugin.MojoExecutionException - in case of a failure
      org.apache.maven.plugin.MojoFailureException - in case of a failure
    • doExecute

      protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Main mojo execution code
      Throws:
      org.apache.maven.plugin.MojoExecutionException - in case of a failure
      org.apache.maven.plugin.MojoFailureException - in case of a failure
    • appArtifactCoords

      protected String appArtifactCoords()
    • forcedDependencies

      protected List<io.quarkus.maven.dependency.Dependency> forcedDependencies(io.quarkus.runtime.LaunchMode mode)
      Allows implementations to provide extra dependencies that should be enforced on the application. Originally requested by Camel K.
      Parameters:
      mode - launch mode the application is being bootstrapped in
      Returns:
      list of extra dependencies that should be enforced on the application
    • repositorySystem

      @Deprecated(forRemoval=true) protected org.eclipse.aether.RepositorySystem repositorySystem()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • remoteRepositoryManager

      @Deprecated(forRemoval=true) protected org.eclipse.aether.impl.RemoteRepositoryManager remoteRepositoryManager()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • repositorySystemSession

      protected org.eclipse.aether.RepositorySystemSession repositorySystemSession()
    • remoteRepositories

      protected List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories()
    • mavenProject

      protected org.apache.maven.project.MavenProject mavenProject()
    • mavenSession

      public org.apache.maven.execution.MavenSession mavenSession()
    • buildDir

      protected File buildDir()
    • baseDir

      protected File baseDir()
    • finalName

      protected String finalName()
    • manifestEntries

      protected Map<String,String> manifestEntries()
    • manifestSections

      protected List<ManifestSection> manifestSections()
    • ignoredEntries

      protected String[] ignoredEntries()
    • properties

      protected Map<String,String> properties()
    • bootstrapId

      protected String bootstrapId()
    • projectId

      protected io.quarkus.maven.dependency.ArtifactKey projectId()
    • bootstrapApplication

      protected io.quarkus.bootstrap.app.CuratedApplication bootstrapApplication() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • bootstrapApplication

      protected io.quarkus.bootstrap.app.CuratedApplication bootstrapApplication(io.quarkus.runtime.LaunchMode mode) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • closeApplication

      protected void closeApplication(io.quarkus.runtime.LaunchMode mode)
    • getWorkspaceId

      protected int getWorkspaceId()
      Workspace ID associated with a given bootstrap mojo. If the returned value is 0, a workspace was not associated with the bootstrap mojo.
      Returns:
      workspace ID associated with a given bootstrap mojo
    • bootstrapApplication

      protected io.quarkus.bootstrap.app.CuratedApplication bootstrapApplication(io.quarkus.runtime.LaunchMode mode, Consumer<io.quarkus.bootstrap.app.QuarkusBootstrap.Builder> builderCustomizer) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getBuildSystemProperties

      protected Properties getBuildSystemProperties(boolean quarkusOnly) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • setNativeEnabledIfNativeProfileEnabled

      protected boolean setNativeEnabledIfNativeProfileEnabled()
      Cause the native-enabled flag to be set if the native profile is enabled.
      Returns:
      true if the package type system property was set, otherwise - false
    • isNativeProfileEnabled

      static boolean isNativeProfileEnabled(org.apache.maven.project.MavenProject mavenProject)