Fork me on GitHub

application:generate

Full name:

net.oneandone.maven.plugins:application:1.6.3-SNAPSHOT:generate

Description:

Generates an application file. Merges dependency jars into a single file, prepended with a launch shell script.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: package.

Required Parameters

Name Type Since Description
main String - Main class to be launched. Specified as a fully qualified Java Class name. Similar to the main class specified when you start the JVM.

Optional Parameters

Name Type Since Description
attach boolean - When true, generated application files will be deployed to the Maven repository
Default value is: true.
classifier String - Classifier to deploy application files with. Specify a different value if you want to deploy multiple applications.
Default value is: application.
concat String - Dependency jar entries to be concatenated before adding them to the application file. Comma-separated list of patterns.
dir FileNode - Directory where to place the Launch Script and the executable Jar file. Usually, there's no need to change the default value, which is target.
Default value is: ${project.build.directory}.
equal String - Dependency jar file entries that may be duplicates if they are equal. Comma-separated list of patterns. Only one of the duplicates will be added to the application file.
extensions List - Copied verbatim to the launch code right before the final Java call, placing each extension on a new line. You have access to the following script variables: MAIN (the main class as specified in your pom), NAME (application name as specified in your pom), OPTIONS (as specified in your pom) and APP (absolute normalized path to the application file). Note that these variables are not exported, to access them from your application, you have to turn them into properties!
java String - Name of the Java Executable to be invoked by the script. Only a file name, without path.
Default value is: java.
launcher String - File with a launcher template. Overrides the built-in template.
name String - Name for the generated application file.
Default value is: ${project.artifactId}.
options String - Fixed options passed to Java VM. You can use this to make local shell variables used in the launch script available Java. E.g. use "-Dapp=$APP" to make the fully qualified application name available as a system property "app". Another example: use "-Dapporig=$0" to get the original name this application was invoked with.
overwrite String - Dependency jar file entries that may overlap: the last entry will be added to the application file, all previous entries get lost. Comma-separated list of patterns.
path String - Path to search the Java Executable. Defaults to the default search path. Change this variable to specify a different location to search for java.
Default value is: $PATH.
permissions String - Permissions for application file.
Default value is: rwxr-xr-x.
projectJar String - Specifies the jar of the project to add to the application file.
Default value is: ${project.build.directory}/${project.build.finalName}.jar.
remove String - Dependency jar entries that will not be added to the application file. Comma-separated list of patterns.
scopes List - Scopes to include in compound jar. There's usually no need to touch this option. Defaults to "compile" and "runtime".
shrink boolean - True to remove unused code from that application file. Be careful with this parameter - if your application relies on reflection or introspection, you need proper shrinkOptions to declare them.
Default value is: false.
shrinkOptions String - Proguard options as defined at http://proguard.sourceforge.net/manual/usage.html The application plugin supplied proper in- and output options, library options and a keep option for the main method. It also disables obfuscation. Everything else you need can be defined here.
type String - Type to deploy application files with.
Default value is: sh.

Parameter Details

attach:

When true, generated application files will be deployed to the Maven repository
  • Type: boolean
  • Required: No
  • Default: true

classifier:

Classifier to deploy application files with. Specify a different value if you want to deploy multiple applications.
  • Type: java.lang.String
  • Required: No
  • Default: application

concat:

Dependency jar entries to be concatenated before adding them to the application file. Comma-separated list of patterns.
  • Type: java.lang.String
  • Required: No

dir:

Directory where to place the Launch Script and the executable Jar file. Usually, there's no need to change the default value, which is target.
  • Type: net.oneandone.sushi.fs.file.FileNode
  • Required: No
  • Default: ${project.build.directory}

equal:

Dependency jar file entries that may be duplicates if they are equal. Comma-separated list of patterns. Only one of the duplicates will be added to the application file.
  • Type: java.lang.String
  • Required: No

extensions:

Copied verbatim to the launch code right before the final Java call, placing each extension on a new line. You have access to the following script variables: MAIN (the main class as specified in your pom), NAME (application name as specified in your pom), OPTIONS (as specified in your pom) and APP (absolute normalized path to the application file). Note that these variables are not exported, to access them from your application, you have to turn them into properties!
  • Type: java.util.List
  • Required: No

java:

Name of the Java Executable to be invoked by the script. Only a file name, without path.
  • Type: java.lang.String
  • Required: No
  • Default: java

launcher:

File with a launcher template. Overrides the built-in template.
  • Type: java.lang.String
  • Required: No

main:

Main class to be launched. Specified as a fully qualified Java Class name. Similar to the main class specified when you start the JVM.
  • Type: java.lang.String
  • Required: Yes

name:

Name for the generated application file.
  • Type: java.lang.String
  • Required: No
  • Default: ${project.artifactId}

options:

Fixed options passed to Java VM. You can use this to make local shell variables used in the launch script available Java. E.g. use "-Dapp=$APP" to make the fully qualified application name available as a system property "app". Another example: use "-Dapporig=$0" to get the original name this application was invoked with.
  • Type: java.lang.String
  • Required: No

overwrite:

Dependency jar file entries that may overlap: the last entry will be added to the application file, all previous entries get lost. Comma-separated list of patterns.
  • Type: java.lang.String
  • Required: No

path:

Path to search the Java Executable. Defaults to the default search path. Change this variable to specify a different location to search for java.
  • Type: java.lang.String
  • Required: No
  • Default: $PATH

permissions:

Permissions for application file.
  • Type: java.lang.String
  • Required: No
  • Default: rwxr-xr-x

projectJar:

Specifies the jar of the project to add to the application file.
  • Type: java.lang.String
  • Required: No
  • Default: ${project.build.directory}/${project.build.finalName}.jar

remove:

Dependency jar entries that will not be added to the application file. Comma-separated list of patterns.
  • Type: java.lang.String
  • Required: No

scopes:

Scopes to include in compound jar. There's usually no need to touch this option. Defaults to "compile" and "runtime".
  • Type: java.util.List
  • Required: No

shrink:

True to remove unused code from that application file. Be careful with this parameter - if your application relies on reflection or introspection, you need proper shrinkOptions to declare them.
  • Type: boolean
  • Required: No
  • Default: false

shrinkOptions:

Proguard options as defined at http://proguard.sourceforge.net/manual/usage.html The application plugin supplied proper in- and output options, library options and a keep option for the main method. It also disables obfuscation. Everything else you need can be defined here.
  • Type: java.lang.String
  • Required: No

type:

Type to deploy application files with.
  • Type: java.lang.String
  • Required: No
  • Default: sh