You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/06/05 14:27:45 UTC
svn commit: r1797668 -
/maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
Author: khmarbaise
Date: Mon Jun 5 14:27:45 2017
New Revision: 1797668
URL: http://svn.apache.org/viewvc?rev=1797668&view=rev
Log:
Updated jlink command line options to be in line
with the most recent version of jlink from JDK9+172.
Added the following options:
o --bind-services (bindServices)
o --disable-plugin (disablePlugin)
o --ignore-signing-information (ignoreSigningInformation)
o --no-header-files (noHeaderFiles)
o --no-man-pages (noManPages)
o --suggest-providers (suggestProviders)
o --verbose (verbose).
Modified:
maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
Modified: maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java?rev=1797668&r1=1797667&r2=1797668&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java (original)
+++ maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java Mon Jun 5 14:27:45 2017
@@ -39,22 +39,42 @@ import org.codehaus.plexus.util.cli.Comm
/**
* <pre>
- * Usage: jlink <options> --module-path <modulepath> --add-modules <mods> --output <path>
+ * Usage: jlink <options> --module-path <modulepath> --add-modules <module>[,<module>...]
* Possible options include:
- * -h, --help Print this help message
- * -p <modulepath>
- * --module-path <modulepath> Module path
- * --limit-modules <mod>[,<mod>...] Limit the universe of observable modules
- * --add-modules <mod>[,<mod>...] Root modules to resolve
- * --output <path> Location of output path
- * --endian <little|big> Byte order of generated jimage (default:native)
- * --version Version information
- * --save-opts <filename> Save jlink options in the given file
- * -G, --strip-debug Strip debug information
- * -c, --compress=<0|1|2> Enable compression of resources (level 2)
- * --plugin-module-path <modulepath> Custom plugin module path
- * --list-plugins List available plugins
- * @<filename> Read options from file
+ * --add-modules <mod>[,<mod>...] Root modules to resolve
+ * --bind-services Link in service provider modules and
+ * their dependences
+ * -c, --compress=<0|1|2> Enable compression of resources:
+ * Level 0: No compression
+ * Level 1: Constant string sharing
+ * Level 2: ZIP
+ * --disable-plugin <pluginname> Disable the plugin mentioned
+ * --endian <little|big> Byte order of generated jimage
+ * (default:native)
+ * -h, --help Print this help message
+ * --ignore-signing-information Suppress a fatal error when signed
+ * modular JARs are linked in the image.
+ * The signature related files of the
+ * signed modular JARs are not copied to
+ * the runtime image.
+ * --launcher <name>=<module>[/<mainclass>]
+ * Add a launcher command of the given
+ * name for the module and the main class
+ * if specified
+ * --limit-modules <mod>[,<mod>...] Limit the universe of observable
+ * modules
+ * --list-plugins List available plugins
+ * -p, --module-path <path> Module path
+ * --no-header-files Exclude include header files
+ * --no-man-pages Exclude man pages
+ * --output <path> Location of output path
+ * --save-opts <filename> Save jlink options in the given file
+ * -G, --strip-debug Strip debug information
+ * --suggest-providers [<name>,...] Suggest providers that implement the
+ * given service types from the module path
+ * -v, --verbose Enable verbose tracing
+ * --version Version information
+ * @<filename> Read options from file
* </pre>
*
* @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
@@ -117,6 +137,48 @@ public class JLinkMojo
@Parameter( defaultValue = "${project.compileClasspathElements}", readonly = true, required = true )
private List<String> modulePaths;
+ /**
+ * Add the option <code>--bind-services</code> or not.
+ */
+ @Parameter( defaultValue = "false" )
+ private boolean bindServices;
+
+ /**
+ * --disable-plugin pluginName.
+ */
+ @Parameter
+ private String disablePlugin;
+
+ /**
+ * <code>--ignore-signing-information</code>
+ */
+ @Parameter( defaultValue = "false" )
+ private boolean ignoreSigningInformation;
+
+ /**
+ * <code>--no-header-files</code>
+ */
+ @Parameter( defaultValue = "false" )
+ private boolean noHeaderFiles;
+
+ /**
+ * <code>--no-man-pages</code>
+ */
+ @Parameter( defaultValue = "false" )
+ private boolean noManPages;
+
+ /**
+ * --suggest-providers [<name>,...] Suggest providers that implement the given service types from the module path
+ */
+ @Parameter
+ private List<String> suggestProviders;
+
+ /**
+ * <code>--verbose</code>
+ */
+ @Parameter( defaultValue = "false" )
+ private boolean verbose;
+
public void execute()
throws MojoExecutionException, MojoFailureException
{
@@ -289,18 +351,50 @@ public class JLinkMojo
argsFile.println( "--strip-debug" );
}
+ if ( bindServices )
+ {
+ argsFile.println( "--bind-services" );
+ }
+
+ if ( ignoreSigningInformation )
+ {
+ argsFile.println( "--ignore-signing-information" );
+ }
if ( compression != null )
{
argsFile.println( "--compression" );
argsFile.println( compression );
}
+ if ( disablePlugin != null )
+ {
+ argsFile.println( "--disable-plugin" );
+ argsFile.append( '"' ).append( disablePlugin ).println( '"' );
+
+ }
if ( modulePaths != null )
{
argsFile.println( "--module-path" );
argsFile.append( '"' ).append( getColonSeparateList( modulePaths ).replace( "\\", "\\\\" ) ).println( '"' );
}
+ if ( noHeaderFiles )
+ {
+ argsFile.println( "--no-header-files" );
+ }
+
+ if ( noManPages )
+ {
+ argsFile.println( "--no-man-pages" );
+ }
+
+ if ( suggestProviders != null && !suggestProviders.isEmpty() )
+ {
+ argsFile.println( "--suggest-providers" );
+ StringBuilder sb = getCommaSeparatedList( suggestProviders );
+ argsFile.println( sb.toString() );
+ }
+
if ( limitModules != null && !limitModules.isEmpty() )
{
argsFile.println( "--limit-modules" );
@@ -321,6 +415,10 @@ public class JLinkMojo
argsFile.println( outputDirectory );
}
+ if ( verbose )
+ {
+ argsFile.println( "--verbose" );
+ }
argsFile.close();
Commandline cmd = new Commandline();