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
public abstract class AbstractNativeImageMojo extends AbstractNativeMojo
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.FileagentResourceDirectoryprotected java.util.List<java.lang.String>buildArgsprotected java.io.FileclassesDirectoryprotected java.util.List<java.lang.String>classpathprotected java.util.List<java.lang.String>configFilesprotected booleandebugprotected java.io.FiledefaultClassesDirectoryprotected booleandryRunprotected java.util.Map<java.lang.String,java.lang.String>environmentprotected java.util.List<ExcludeConfigConfiguration>excludeConfigprotected booleanfallbackprotected java.util.List<java.nio.file.Path>imageClasspathprotected java.lang.StringimageNameprotected java.util.List<java.lang.String>jvmArgsprotected java.lang.StringmainClassprotected org.apache.maven.plugin.MojoExecutionmojoExecutionprotected static java.lang.StringNATIVE_IMAGE_DRY_RUNprotected static java.lang.StringNATIVE_IMAGE_META_INFprotected static java.lang.StringNATIVE_IMAGE_PROPERTIES_FILENAMEprotected java.io.FileoutputDirectoryprotected org.apache.maven.plugin.descriptor.PluginDescriptorpluginprotected java.util.List<org.apache.maven.artifact.Artifact>pluginArtifactsprotected booleanquickBuildprotected java.lang.StringrequiredVersionprotected java.io.FileresourcesConfigDirectoryprotected org.apache.maven.execution.MavenSessionsessionprotected booleansharedLibraryprotected java.util.Map<java.lang.String,java.lang.String>systemPropertiesprotected org.apache.maven.toolchain.ToolchainManagertoolchainManagerprotected java.lang.BooleanuseArgFileprotected booleanverbose-
Fields inherited from class org.graalvm.buildtools.maven.AbstractNativeMojo
logger, mavenSession, metadataRepository, metadataRepositoryConfiguration, metadataRepositoryConfigurations, project, reachabilityMetadataOutputDirectory, repositorySystem
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNativeImageMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddArtifactToClasspath(org.apache.maven.artifact.Artifact artifact)protected voidaddDependenciesToClasspath()protected voidbuildImage()protected voidcheckRequiredVersionIfNeeded()protected java.util.List<java.lang.String>getBuildArgs()protected java.lang.StringgetClasspath()protected abstract java.util.List<java.lang.String>getDependencyScopes()protected java.nio.file.PathgetMainBuildPath()Returns path to where application classes are stored, or jar artifact if it is produced.protected voidmaybeAddGeneratedResourcesConfig(java.util.List<java.lang.String> into)protected voidmaybeAddReachabilityMetadata(java.util.List<java.lang.String> configDirs)protected voidpopulateApplicationClasspath()protected voidpopulateClasspath()protected java.nio.file.PathprocessArtifact(org.apache.maven.artifact.Artifact artifact, java.lang.String... artifactTypes)protected java.nio.file.PathprocessSupportedArtifacts(org.apache.maven.artifact.Artifact artifact)protected voidwarnIfWrongMetaInfLayout(java.nio.file.Path jarFilePath, org.apache.maven.artifact.Artifact artifact)-
Methods inherited from class org.graalvm.buildtools.maven.AbstractNativeMojo
configureMetadataRepository, downloadMetadata, getMetadataVersion, isArtifactExcludedFromMetadataRepository, isMetadataRepositoryEnabled, maybeAddDependencyMetadata, unzipLocalMetadata
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
NATIVE_IMAGE_META_INF
protected static final java.lang.String NATIVE_IMAGE_META_INF
- See Also:
- Constant Field Values
-
NATIVE_IMAGE_PROPERTIES_FILENAME
protected static final java.lang.String NATIVE_IMAGE_PROPERTIES_FILENAME
- See Also:
- Constant Field Values
-
NATIVE_IMAGE_DRY_RUN
protected static final java.lang.String NATIVE_IMAGE_DRY_RUN
- See Also:
- Constant Field Values
-
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 java.util.List<org.apache.maven.artifact.Artifact> pluginArtifacts
-
outputDirectory
@Parameter(defaultValue="${project.build.directory}", property="outputDir", required=true) protected java.io.File outputDirectory
-
mainClass
@Parameter(property="mainClass") protected java.lang.String mainClass
-
imageName
@Parameter(property="imageName", defaultValue="${project.artifactId}") protected java.lang.String imageName
-
classpath
@Parameter(property="classpath") protected java.util.List<java.lang.String> classpath
-
classesDirectory
@Parameter(property="classesDirectory") protected java.io.File classesDirectory
-
defaultClassesDirectory
@Parameter(defaultValue="${project.build.outputDirectory}", readonly=true, required=true) protected java.io.File defaultClassesDirectory
-
imageClasspath
protected final java.util.List<java.nio.file.Path> 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
-
sharedLibrary
@Parameter(property="sharedLibrary", defaultValue="false") protected boolean sharedLibrary
-
quickBuild
@Parameter(property="quickBuild", defaultValue="false") protected boolean quickBuild
-
useArgFile
@Parameter(property="useArgFile") protected java.lang.Boolean useArgFile
-
buildArgs
@Parameter(property="buildArgs") protected java.util.List<java.lang.String> buildArgs
-
resourcesConfigDirectory
@Parameter(defaultValue="${project.build.directory}/native/generated", property="resourcesConfigDirectory", required=true) protected java.io.File resourcesConfigDirectory
-
agentResourceDirectory
@Parameter(property="agentResourceDirectory") protected java.io.File agentResourceDirectory
-
excludeConfig
@Parameter(property="excludeConfig") protected java.util.List<ExcludeConfigConfiguration> excludeConfig
-
environment
@Parameter(property="environmentVariables") protected java.util.Map<java.lang.String,java.lang.String> environment
-
systemProperties
@Parameter(property="systemPropertyVariables") protected java.util.Map<java.lang.String,java.lang.String> systemProperties
-
configFiles
@Parameter(property="configurationFileDirectories") protected java.util.List<java.lang.String> configFiles
-
jvmArgs
@Parameter(property="jvmArgs") protected java.util.List<java.lang.String> jvmArgs
-
dryRun
@Parameter(property="nativeDryRun", defaultValue="false") protected boolean dryRun
-
requiredVersion
@Parameter(property="requiredVersion") protected java.lang.String requiredVersion
-
toolchainManager
@Component protected org.apache.maven.toolchain.ToolchainManager toolchainManager
-
-
Method Detail
-
getBuildArgs
protected java.util.List<java.lang.String> getBuildArgs() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
processSupportedArtifacts
protected java.nio.file.Path processSupportedArtifacts(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
processArtifact
protected java.nio.file.Path processArtifact(org.apache.maven.artifact.Artifact artifact, java.lang.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(java.nio.file.Path jarFilePath, org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getDependencyScopes
protected abstract java.util.List<java.lang.String> getDependencyScopes()
-
addDependenciesToClasspath
protected void addDependenciesToClasspath() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getMainBuildPath
protected java.nio.file.Path getMainBuildPath() throws org.apache.maven.plugin.MojoExecutionExceptionReturns 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
protected java.lang.String getClasspath() throws org.apache.maven.plugin.MojoExecutionException- 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
-
maybeAddGeneratedResourcesConfig
protected void maybeAddGeneratedResourcesConfig(java.util.List<java.lang.String> into)
-
maybeAddReachabilityMetadata
protected void maybeAddReachabilityMetadata(java.util.List<java.lang.String> configDirs)
-
-