Package org.tentackle.maven.plugin.jlink
Class InitMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.tentackle.maven.AbstractTentackleMojo
-
- org.tentackle.maven.plugin.jlink.AbstractJLinkMojo
-
- org.tentackle.maven.plugin.jlink.InitMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="init", inheritByDefault=false, aggregator=true) public class InitMojo extends AbstractJLinkMojoInitializes the templates.
Copies the default templates to the project's template directory.
-
-
Field Summary
-
Fields inherited from class org.tentackle.maven.plugin.jlink.AbstractJLinkMojo
DEST_CLASSPATH, DEST_MODULEPATH, DEST_RESOURCES, ZIP_EXTENSION
-
-
Constructor Summary
Constructors Constructor Description InitMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateJLinkImage(JLinkResolver.Result result)Creates the jlink image.voidexecuteImpl()protected voidgenerateFiles(JLinkResolver.Result result)Generates additional files such as shell scripts or command files.java.io.FilegetImageDirectory()Gets the directory created by jlink holding the image.protected voidinstallTemplates(boolean overwrite)Copies the templates to the template directory.-
Methods inherited from class org.tentackle.maven.plugin.jlink.AbstractJLinkMojo
copyArtifacts, copyExtraDirectories, copyResources, createImage, createZipFile, getAddModules, getClassifier, getExcludeModules, getExtraClassifier, getExtraClasspathElements, getExtraDirectories, getFinalName, getImagePathPrefix, getJavaMajorRuntimeVersion, getJavaRuntimeVersion, getJdepsTool, getLocationManager, getMainClass, getMainModule, getProjectHelper, getTemplateDir, getVariables, getVariablesPrecedence, getZipDirectory, installTemplate, isClasspathDependency, isModulePathOnly, isWithUpdater, logToolOutput, prepareExecute, validate
-
Methods inherited from class org.tentackle.maven.AbstractTentackleMojo
createPackageMap, determineEncoding, determineJavaToolVersion, determineVerbosity, execute, findResourceDirs, finishExecute, getCanonicalPath, getHostName, getMajorVersion, getMavenProject, getMavenSession, getMojoExecution, getPathRelativeToBasedir, getResourceDirName, getSettings, getSettingsDecrypter, getToolchain, getToolchain, getToolchain, getToolchainManager, getToolFinder, installJavaLoggingHandler, isExecutionRecursive, isSkippedByDefault, loadResourceFileIntoString
-
-
-
-
Method Detail
-
executeImpl
public void executeImpl() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Overrides:
executeImplin classAbstractJLinkMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
installTemplates
protected void installTemplates(boolean overwrite) throws org.apache.maven.plugin.MojoExecutionExceptionDescription copied from class:AbstractJLinkMojoCopies the templates to the template directory.- Specified by:
installTemplatesin classAbstractJLinkMojo- Parameters:
overwrite- true if overwrite existing templates, false if install only missing- Throws:
org.apache.maven.plugin.MojoExecutionException- if installation failed
-
createJLinkImage
protected void createJLinkImage(JLinkResolver.Result result) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Description copied from class:AbstractJLinkMojoCreates the jlink image.- Overrides:
createJLinkImagein classAbstractJLinkMojo- Parameters:
result- the resolver info- Throws:
org.apache.maven.plugin.MojoExecutionException- if building the JPMS info failedorg.apache.maven.plugin.MojoFailureException- if jlink returned an error code
-
getImageDirectory
public java.io.File getImageDirectory()
Description copied from class:AbstractJLinkMojoGets the directory created by jlink holding the image.- Overrides:
getImageDirectoryin classAbstractJLinkMojo- Returns:
- the image dir, never null
-
generateFiles
protected void generateFiles(JLinkResolver.Result result) throws org.apache.maven.plugin.MojoExecutionException
Description copied from class:AbstractJLinkMojoGenerates additional files such as shell scripts or command files.- Specified by:
generateFilesin classAbstractJLinkMojo- Parameters:
result- the resolver result- Throws:
org.apache.maven.plugin.MojoExecutionException- if generation failed
-
-