Package io.quarkus.maven
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 Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) StringApplication bootstrap provider ID.protected QuarkusBootstrapProvider(package private) static final String(package private) BooleanWhether to close the bootstrapped applications after the execution(package private) static final String(package private) org.apache.maven.plugin.MojoExecutionThe context of the execution of the plugin.(package private) static final String(package private) static final StringPOM files from the workspace that should be reloaded from the disk instead of taken from the Maven reactor.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected FilebaseDir()protected abstract booleanThis callback allows to evaluate whether this mojo should be executed, skipped or fail.protected io.quarkus.bootstrap.app.CuratedApplicationprotected io.quarkus.bootstrap.app.CuratedApplicationbootstrapApplication(io.quarkus.runtime.LaunchMode mode) protected io.quarkus.bootstrap.app.CuratedApplicationbootstrapApplication(io.quarkus.runtime.LaunchMode mode, Consumer<io.quarkus.bootstrap.app.QuarkusBootstrap.Builder> builderCustomizer) protected Stringprotected FilebuildDir()protected voidcloseApplication(io.quarkus.runtime.LaunchMode mode) protected abstract voidMain mojo execution codevoidexecute()protected Stringprotected 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.protected PropertiesgetBuildSystemProperties(boolean quarkusOnly) protected intWorkspace ID associated with a given bootstrap mojo.protected String[](package private) static booleanisNativeProfileEnabled(org.apache.maven.project.MavenProject mavenProject) protected List<ManifestSection> protected org.apache.maven.project.MavenProjectorg.apache.maven.execution.MavenSessionprotected io.quarkus.maven.dependency.ArtifactKeyprotected List<org.eclipse.aether.repository.RemoteRepository> protected org.eclipse.aether.impl.RemoteRepositoryManagerDeprecated, for removal: This API element is subject to removal in a future version.protected org.eclipse.aether.RepositorySystemDeprecated, for removal: This API element is subject to removal in a future version.protected org.eclipse.aether.RepositorySystemSessionvoidsetLog(org.apache.maven.plugin.logging.Log log) protected booleanCause the native-enabled flag to be set if the native profile is enabled.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setPluginContext
-
Field Details
-
BOOTSTRAP_ID_PARAM
- See Also:
-
CLOSE_BOOTSTRAPPED_APP_PARAM
- See Also:
-
MODE_PARAM
- See Also:
-
RELOAD_POMS_PARAM
- See Also:
-
NATIVE_PROFILE_NAME
- See Also:
-
bootstrapProvider
-
mojoExecution
@Parameter(defaultValue="${mojoExecution}", readonly=true, required=true) org.apache.maven.plugin.MojoExecution mojoExecutionThe context of the execution of the plugin. -
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 inDevMojoinvokinggenerate-codeandgenerate-code-testsgoals. If this parameter is not configured, a Mojo execution ID will be used as the bootstrap ID. -
closeBootstrappedApp
Whether to close the bootstrapped applications after the execution -
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.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
setLog
public void setLog(org.apache.maven.plugin.logging.Log log) - Specified by:
setLogin interfaceorg.apache.maven.plugin.Mojo- Overrides:
setLogin classorg.apache.maven.plugin.AbstractMojo
-
beforeExecute
protected abstract boolean beforeExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionThis 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 failureorg.apache.maven.plugin.MojoFailureException- in case of a failure
-
doExecute
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionMain mojo execution code- Throws:
org.apache.maven.plugin.MojoExecutionException- in case of a failureorg.apache.maven.plugin.MojoFailureException- in case of a failure
-
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, 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
-
mavenProject
protected org.apache.maven.project.MavenProject mavenProject() -
mavenSession
public org.apache.maven.execution.MavenSession mavenSession() -
buildDir
-
baseDir
-
finalName
-
manifestEntries
-
manifestSections
-
ignoredEntries
-
properties
-
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 is0, 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)
-