Package org.apache.maven.plugins.jlink
Class AbstractJLinkMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.jlink.AbstractJLinkMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
JLinkMojo
public abstract class AbstractJLinkMojo
extends org.apache.maven.plugin.AbstractMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionSpecify the requirements for this jdk toolchain.private org.apache.maven.project.MavenProjectprivate org.apache.maven.execution.MavenSessionprivate org.apache.maven.toolchain.ToolchainManagerFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuilderconvertSeparatedModulePathToPlatformSeparatedModulePath(String pluginModulePath) This will convert a module path separated by either:or;into a string which uses the platform depend path separator uniformly.protected voidexecuteCommand(org.codehaus.plexus.util.cli.Commandline cmd, File outputDirectory) protected FilegetArchiveFile(File basedir, String finalName, String classifier, String archiveExt) Returns the archive file to generate, based on an optional classifier.protected StringgetCommaSeparatedList(List<String> modules) Convert a list into aprotected Stringprotected StringgetPlatformDependSeparateList(List<String> modulePaths) Convert a list into a string which is separated by platform depend path separator.protected org.apache.maven.project.MavenProjectprotected org.apache.maven.execution.MavenSessionprotected org.apache.maven.toolchain.Toolchainprotected booleanhasClassifier(String classifier) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
jdkToolchain
Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the maven-toolchain-plugin.
note: requires at least Maven 3.3.1 -
project
@Parameter(defaultValue="${project}", readonly=true, required=true) private org.apache.maven.project.MavenProject project -
session
@Parameter(defaultValue="${session}", readonly=true, required=true) private org.apache.maven.execution.MavenSession session -
toolchainManager
@Component private org.apache.maven.toolchain.ToolchainManager toolchainManager
-
-
Constructor Details
-
AbstractJLinkMojo
public AbstractJLinkMojo()
-
-
Method Details
-
getJLinkExecutable
- Throws:
IOException
-
executeCommand
protected void executeCommand(org.codehaus.plexus.util.cli.Commandline cmd, File outputDirectory) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getToolchain
protected org.apache.maven.toolchain.Toolchain getToolchain() -
getProject
protected org.apache.maven.project.MavenProject getProject() -
getSession
protected org.apache.maven.execution.MavenSession getSession() -
getArchiveFile
Returns the archive file to generate, based on an optional classifier.- Parameters:
basedir- the output directoryfinalName- the name of the ear fileclassifier- an optional classifierarchiveExt- The extension of the file.- Returns:
- the file to generate
-
hasClassifier
-
convertSeparatedModulePathToPlatformSeparatedModulePath
protected StringBuilder convertSeparatedModulePathToPlatformSeparatedModulePath(String pluginModulePath) This will convert a module path separated by either:or;into a string which uses the platform depend path separator uniformly.- Parameters:
pluginModulePath- The module path.- Returns:
- The platform separated module path.
-
getPlatformDependSeparateList
Convert a list into a string which is separated by platform depend path separator.- Parameters:
modulePaths- The list of elements.- Returns:
- The string which contains the elements separated by
File.pathSeparatorChar.
-
getCommaSeparatedList
Convert a list into a- Parameters:
modules- The list of modules.- Returns:
- The string with the module list which is separated by
,.
-