Package org.graalvm.buildtools.maven
Class AbstractNativeImageMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.graalvm.buildtools.maven.AbstractNativeMojo
org.graalvm.buildtools.maven.AbstractNativeImageMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
NativeCompileNoForkMojo
,NativeTestMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected File
protected File
protected boolean
protected File
protected boolean
protected List<ExcludeConfigConfiguration>
protected List<org.apache.maven.model.Exclusion>
protected boolean
protected String
protected String
protected org.apache.maven.plugin.MojoExecution
protected static final String
protected static final String
protected static final String
protected File
protected org.apache.maven.plugin.descriptor.PluginDescriptor
protected List<org.apache.maven.artifact.Artifact>
protected boolean
protected String
protected File
protected org.apache.maven.execution.MavenSession
protected boolean
protected org.apache.maven.toolchain.ToolchainManager
protected Boolean
protected boolean
Fields inherited from class org.graalvm.buildtools.maven.AbstractNativeMojo
logger, mavenProject, mavenSession, metadataRepository, metadataRepositoryConfiguration, metadataRepositoryConfigurations, metadataRepositoryInitialBackoffMillis, metadataRepositoryMaxRetries, pluginManager, project, reachabilityMetadataOutputDirectory, repositorySystem
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addArtifactToClasspath
(org.apache.maven.artifact.Artifact artifact) protected void
protected void
protected void
protected void
protected String
protected Path
Returns path to where application classes are stored, or jar artifact if it is produced.protected static String
getVersionInformation
(org.codehaus.plexus.logging.Logger logger) Returns the output of calling "native-image --version".protected boolean
isExcluded
(org.apache.maven.artifact.Artifact dependency) protected static boolean
isOracleGraalVM
(org.codehaus.plexus.logging.Logger logger) protected void
maybeAddDependencyMetadata
(org.apache.maven.artifact.Artifact dependency, Consumer<File> excludeAction) protected void
protected void
maybeAddReachabilityMetadata
(List<String> configDirs) protected void
protected void
protected Path
processArtifact
(org.apache.maven.artifact.Artifact artifact, String... artifactTypes) protected Path
processSupportedArtifacts
(org.apache.maven.artifact.Artifact artifact) protected void
warnIfWrongMetaInfLayout
(Path jarFilePath, org.apache.maven.artifact.Artifact artifact) Methods inherited from class org.graalvm.buildtools.maven.AbstractNativeMojo
configureMetadataRepository, downloadMetadata, getMetadataVersion, isArtifactExcludedFromMetadataRepository, isMetadataRepositoryEnabled, unzipLocalMetadata
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
NATIVE_IMAGE_META_INF
- See Also:
-
NATIVE_IMAGE_PROPERTIES_FILENAME
- See Also:
-
NATIVE_IMAGE_DRY_RUN
- See Also:
-
plugin
@Parameter(defaultValue="${plugin}", readonly=true) protected org.apache.maven.plugin.descriptor.PluginDescriptor plugin -
session
@Parameter(defaultValue="${session}", readonly=true) protected org.apache.maven.execution.MavenSession session -
mojoExecution
@Parameter(defaultValue="${mojoExecution}") protected org.apache.maven.plugin.MojoExecution mojoExecution -
pluginArtifacts
@Parameter(property="plugin.artifacts", required=true, readonly=true) protected List<org.apache.maven.artifact.Artifact> pluginArtifacts -
outputDirectory
@Parameter(defaultValue="${project.build.directory}", property="outputDir", required=true) protected File outputDirectory -
mainClass
-
imageName
-
classpath
-
classesDirectory
-
defaultClassesDirectory
@Parameter(defaultValue="${project.build.outputDirectory}", readonly=true, required=true) protected File defaultClassesDirectory -
imageClasspath
-
debug
@Parameter(property="debug", defaultValue="false") protected boolean debug -
fallback
@Parameter(property="fallback", defaultValue="false") protected boolean fallback -
verbose
@Parameter(property="verbose", defaultValue="false") protected boolean verbose -
quickBuild
@Parameter(property="quickBuild", defaultValue="false") protected boolean quickBuild -
useArgFile
-
buildArgs
-
resourcesConfigDirectory
@Parameter(defaultValue="${project.build.directory}/native/generated", property="resourcesConfigDirectory", required=true) protected File resourcesConfigDirectory -
agentResourceDirectory
-
excludeConfig
-
environment
-
systemProperties
-
configFiles
-
jvmArgs
-
runtimeArgs
-
dryRun
@Parameter(property="nativeDryRun", defaultValue="false") protected boolean dryRun -
requiredVersion
-
exclusions
-
toolchainManager
@Component protected org.apache.maven.toolchain.ToolchainManager toolchainManager
-
-
Constructor Details
-
AbstractNativeImageMojo
@Inject protected AbstractNativeImageMojo()
-
-
Method Details
-
getBuildArgs
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
processSupportedArtifacts
protected Path processSupportedArtifacts(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
processArtifact
protected Path processArtifact(org.apache.maven.artifact.Artifact artifact, String... artifactTypes) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
addArtifactToClasspath
protected void addArtifactToClasspath(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
warnIfWrongMetaInfLayout
protected void warnIfWrongMetaInfLayout(Path jarFilePath, org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getDependencyScopes
-
addDependenciesToClasspath
protected void addDependenciesToClasspath() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addInferredDependenciesToClasspath
protected void addInferredDependenciesToClasspath() -
maybeAddDependencyMetadata
protected void maybeAddDependencyMetadata(org.apache.maven.artifact.Artifact dependency, Consumer<File> excludeAction) - Overrides:
maybeAddDependencyMetadata
in classAbstractNativeMojo
-
isExcluded
protected boolean isExcluded(org.apache.maven.artifact.Artifact dependency) -
getMainBuildPath
Returns path to where application classes are stored, or jar artifact if it is produced.- Returns:
- Path to application classes
- Throws:
org.apache.maven.plugin.MojoExecutionException
- failed getting main build path
-
populateApplicationClasspath
protected void populateApplicationClasspath() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
populateClasspath
protected void populateClasspath() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getClasspath
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
buildImage
protected void buildImage() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
checkRequiredVersionIfNeeded
protected void checkRequiredVersionIfNeeded() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
isOracleGraalVM
protected static boolean isOracleGraalVM(org.codehaus.plexus.logging.Logger logger) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getVersionInformation
protected static String getVersionInformation(org.codehaus.plexus.logging.Logger logger) throws org.apache.maven.plugin.MojoExecutionException Returns the output of calling "native-image --version".- Parameters:
logger
- a logger, that may be null, to print warnings or useful information.- Returns:
- the output as a string joined by "\n".
- Throws:
org.apache.maven.plugin.MojoExecutionException
- when any errors occurred.
-
maybeAddGeneratedResourcesConfig
-
maybeAddReachabilityMetadata
-