Package org.apache.maven.plugins.jmod
Class JModCreateMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.jmod.AbstractJModMojo
org.apache.maven.plugins.jmod.JModCreateMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="create",
requiresDependencyResolution=COMPILE,
defaultPhase=PACKAGE,
requiresProject=true)
public class JModCreateMojo
extends AbstractJModMojo
The
create
goal is intended to create jmod
files which can be used for later linking via
maven-jlink-plugin. The jmod
files
can not be used as usual dependencies on the classpath only in relationship with maven-jlink-plugin
.-
Field Summary
FieldsModifier and TypeFieldDescriptionSpecifies one or more directories containing native commands to be copied.Specifies one or more directories containing configuration files to be copied.private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private boolean
--do-not-resolve-by-default
Exclude from the default root set of modulesExclude files matching the pattern list.Define the locations of header files.private static final String
Define the location of legal notices.Specifies one or more directories containing native libraries to be copied (The given directories are relative to project base directory).private org.codehaus.plexus.languages.java.jpms.LocationManager
private String
Define the main class which is recorded in themodule-info.class
file.Define the locations of man pages.private String
Define the module version of the jmod file.private File
private String
This is only the name of the jmod file in the target directory.private File
private String
--target-platform <target-platform>
Target platform TODO: Which values are valid?private String
Hint for a tool to issue a warning if the module is resolved.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.codehaus.plexus.util.cli.Commandline
createJModCreateCommandLine
(File resultingJModFile) private void
deleteOutputIfAlreadyExists
(File resultingJModFile) private boolean
doDefaultsExist
(String defaultLocation) void
execute()
private void
getCompileClasspathElements
(org.apache.maven.project.MavenProject project) private String
getPlatformSeparatedList
(List<String> paths) handleConfigurationListWithDefault
(List<String> configuration, String defaultLocation) private boolean
isConfigurationDefinedInPOM
(List<String> configuration) private void
resolveAgainstProjectBaseDir
(List<String> relativeDirectories) private void
throwExceptionIfNotExistOrNotADirectory
(List<String> configurations, String partialMessage) private void
writeBoxedWarning
(String message) Methods inherited from class org.apache.maven.plugins.jmod.AbstractJModMojo
executeCommand, getCommaSeparatedList, getJModExecutable, getProject, getSession, getToolchain, projectHasAlreadySetAnArtifact
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
JMODS
- See Also:
-
classpathElements
-
modulepathElements
-
pathElements
-
compilePath
-
locationManager
@Component private org.codehaus.plexus.languages.java.jpms.LocationManager locationManager -
cmds
Specifies one or more directories containing native commands to be copied. The given directories are relative to the current base directory. If no entry is defined the default issrc/main/cmds
used.<cmds> <cmd>...</cmd> <cmd>...</cmd> . . </cmds>
All files from those directories will be copied into the resulting directory
bin
within the jmod file.JMod
command line equivalent:--cmds <path>
. -
DEFAULT_CMD_DIRECTORY
- See Also:
-
configs
Specifies one or more directories containing configuration files to be copied. Location of user-editable config files. If no configuration is given thesrc/main/configs
location is used as default. If this directory does not exist the whole will be ignored.<configs> <config>...</config> <config>...</config> . . </configs>
All files from those directories will be copied into the resulting directory
jmod command line equivalent:config
within the jmod file.--config <path>
. -
DEFAULT_CONFIG_DIRECTORY
- See Also:
-
excludes
Exclude files matching the pattern list. Each element using one the following forms: <glob-pattern>, glob:<glob-pattern> or regex:<regex-pattern><excludes> <exclude>...</exclude> <exclude>...</exclude> . . </excludes>
-
mainClass
Define the main class which is recorded in themodule-info.class
file. -
libs
Specifies one or more directories containing native libraries to be copied (The given directories are relative to project base directory). If no configuration is given in invalid input: '<'invalid input: '<'pom.xml>> file the locationsrc/main/libs
will be used. If the default location does not exist the whole configuration will be ignored.<libs> <lib>...</lib> <lib>...</lib> . . </libs>
All files from those directories will be copied into the resulting directory
lib
within the jmod file. -
DEFAULT_LIB_DIRECTORY
- See Also:
-
moduleVersion
Define the module version of the jmod file. -
doNotResolveByDefault
@Parameter(defaultValue="false") private boolean doNotResolveByDefault--do-not-resolve-by-default
Exclude from the default root set of modules -
headerFiles
Define the locations of header files. The default location issrc/main/headerfiles
. If the the default location does not exist in the current project it will be ignored. The given directories are relative to the project base directory. If an entry is defined the definition of all locations is needed.<headerFiles> <headerFile>...</headerFile> <headerFile>...</headerFile> . . </headerFiles>
All files from those directories will be copied into the resulting directory
jmod command line equivalentincludes
within the jmod file.--header-files <path>
-
DEFAULT_HEADER_FILES_DIRECTORY
- See Also:
-
manPages
Define the locations of man pages. The default location issrc/main/manpages
. The given man pages locations are relative to the project base directory.<manPages> <manPage>...</manPage> <manPage>...</manPage> . . </manPages>
All files from those directories will be copied into the resulting directory
jmod command line equivalentman
within the jmod file.--man-pages <path>
-
DEFAULT_MAN_PAGES_DIRECTORY
- See Also:
-
outputFileName
@Parameter(defaultValue="${project.artifactId}", required=true, readonly=true) private String outputFileNameThis is only the name of the jmod file in the target directory. -
legalNotices
Define the location of legal notices. The default location issrc/main/legalnotices
. The given man pages locations are relative to the project base directory.<legalNotices> <legalNotice>...</legalNotice> <legalNotice>...</legalNotice> . . </legalNotices>
All files from those directories will be copied into the resulting directory
jmod command line equivalentlegal
within the jmod file.--legal-notices <path>
-
DEFAULT_LEGAL_NOTICES_DIRECTORY
- See Also:
-
targetPlatform
--target-platform <target-platform>
Target platform TODO: Which values are valid? -
warnIfResolved
Hint for a tool to issue a warning if the module is resolved. The valid values are:- deprecated
- deprecated-for-removal
- incubating
-
targetClassesDirectory
@Parameter(defaultValue="${project.build.outputDirectory}", required=true, readonly=true) private File targetClassesDirectory -
outputDirectory
@Parameter(defaultValue="${project.build.directory}", required=true, readonly=true) private File outputDirectory -
modulePaths
-
-
Constructor Details
-
JModCreateMojo
public JModCreateMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
deleteOutputIfAlreadyExists
private void deleteOutputIfAlreadyExists(File resultingJModFile) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-
failIfParametersAreNotInTheirValidValueRanges
private void failIfParametersAreNotInTheirValidValueRanges() throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-
throwExceptionIfNotExistOrNotADirectory
private void throwExceptionIfNotExistOrNotADirectory(List<String> configurations, String partialMessage) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-
getCompileClasspathElements
-
preparePaths
private void preparePaths() -
createJModCreateCommandLine
private org.codehaus.plexus.util.cli.Commandline createJModCreateCommandLine(File resultingJModFile) throws IOException - Throws:
IOException
-
isConfigurationDefinedInPOM
-
handleConfigurationListWithDefault
-
resolveAgainstProjectBaseDir
-
doDefaultsExist
-
getPlatformSeparatedList
-
writeBoxedWarning
-