appassembler:assemble

Full name:

org.codehaus.mojo:appassembler-maven-plugin:1.3:assemble

Description:


Assembles the artifacts and generates bin scripts for the configured applications


Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • Binds by default to the lifecycle phase: package.

Required Parameters

Name

Type

Since

Description

assembleDirectory

File

-

The directory that will be used to assemble the artifacts in and place the bin scripts.

Default value is: ${project.build.directory}/appassembler.

programs

Set

-

The set of Programs that bin files will be generated for.


Optional Parameters

Name

Type

Since

Description

binFileExtensions

Map

1.1

The file extensions to use for bin files. The file extensions are stored in a Map that uses the platform name as key. To change the file extension for Unix bin files to ".sh" use this configuration:



<binFileExtensions> <unix>.sh</unix> </binFileExtensions>


binFolder

String

1.2

Define the name of binary folder.

Default value is: bin.

configurationDirectory

String

-

The name of the target directory for configuration files.

Default value is: etc.

configurationSourceDirectory

File

1.1

The name of the source directory for configuration files.

Default value is: src/main/config.

copyConfigurationDirectory

boolean

1.1

If the source configuration directory should be copied to the configured configurationDirectory.

Default value is: false.

environmentSetupFileName

String

-

Setup file in $BASEDIR/bin to be called prior to execution.

extraJvmArguments

String

-

Extra arguments that will be given to the JVM verbatim. If you define JvmSettings on theProgram.setJvmSettings() level this part will be overwritten by the given parameters on program level. Otherwise ifProgram.setJvmSettings() is not given these settings will be used instead. This can be used to define some default values whereas by using theProgram.setJvmSettings() to overwrite the default settings. This is only valid for the extraJvmArguments not for the rest of theJvmSettings. Since 1.2 it's possible to use place holder @BASEDIR@ and@REPO@

generateRepository

boolean

-

Set to false to skip repository generation.

Default value is: true.

includeConfigurationDirectoryInClasspath

boolean

-

If the configurationDirectory (etc by default) should be included in the beginning of the classpath in the generated bin files.

Default value is: true.

licenseHeaderFile

File

1.2

You can define a license header file which will be used instead the default header in the generated scripts.

platforms

Set

-

The default platforms the plugin will generate bin files for. Configure with string values - "all"(default/empty) | "windows" | "unix".

projectArtifactFirstInClassPath

boolean

1.2.1

This can be used to put the project artifact as the first entry in the classpath after the configuration folder (etc by default). The default behavior is to have the project artifact at the last position in classpath.

Default value is: false.

repositoryLayout

String

-

The layout of the generated Maven repository. Supported types - "default" (Maven2) | "legacy" (Maven1) | "flat" (flatlib/ style). The style "legacy" is only supported if you are running under Maven 2.2.1 and before.

Default value is: default.

repositoryName

String

-

Path (relative to assembleDirectory) of the desired output repository.

Default value is: repo.

showConsoleWindow

boolean

-

Show console window when execute this application. When false, the generated java command runs in background. This works best for Swing application where the command line invocation is not blocked.

Default value is: true.

unixScriptTemplate

String

1.3

The unix template of the generated script. It can be a file or resource path. If not given, an internal one is used. Use with case since it not guaranteed to be compatible with new plugin release

useAllDependencies

boolean

1.2.1

Deprecated. Use useallProjectDependencies instead.

Default value is: false.

useAllProjectDependencies

boolean

1.2.3

The following can be used to use all project dependencies instead of the default behavior which representsruntime dependencies only.

Default value is: false.

useAsterikClassPath

boolean

1.2.2

Deprecated. Use useWildcardClassPath instead.

Default value is: false.

useTimestampInSnapshotFileName

boolean

1.3

For those snapshots download from remote repo, replace the timestamp part with "SNAPSHOT" instead

Default value is: true.

useWildcardClassPath

boolean

1.2.3

Sometimes it happens that you have many dependencies which means in other words having a very long classpath. And sometimes the classpath becomes too long (in particular on Windows based platforms). This option can help in such situation. If you activate that your classpath contains only a classpath wildcard (REPO/*). But be aware that this works only in combination with Java 1.6 and above and withrepositoryLayout flat. Otherwise this configuration will not work.

Default value is: false.

windowsScriptTemplate

String

1.3

The windows template of the generated script. It can be a file or resource path. If not given, an internal one is used. Use with case since it is not guaranteed to be compatible with new plugin release


Parameter Details

assembleDirectory:



The directory that will be used to assemble the artifacts in and place the bin scripts.



  • Type: java.io.File
  • Required: Yes
  • Expression: ${assembleDirectory}
  • Default: ${project.build.directory}/appassembler

binFileExtensions:



<binFileExtensions> <unix>.sh</unix> </binFileExtensions>



  • Type: java.util.Map
  • Since: 1.1
  • Required: No

binFolder:



Define the name of binary folder.



  • Type: java.lang.String
  • Since: 1.2
  • Required: No
  • Default: bin

configurationDirectory:



The name of the target directory for configuration files.



  • Type: java.lang.String
  • Required: No
  • Default: etc

configurationSourceDirectory:



The name of the source directory for configuration files.



  • Type: java.io.File
  • Since: 1.1
  • Required: No
  • Default: src/main/config

copyConfigurationDirectory:



configurationDirectory.



  • Type: boolean
  • Since: 1.1
  • Required: No
  • Default: false

environmentSetupFileName:



Setup file in $BASEDIR/bin to be called prior to execution.



  • Type: java.lang.String
  • Required: No

extraJvmArguments:



Program.setJvmSettings() level this part will be overwritten by the given parameters on program level. Otherwise if Program.setJvmSettings() is not given these settings will be used instead. This can be used to define some default values whereas by using the Program.setJvmSettings() to overwrite the default settings. This is only valid for the extraJvmArguments not for the rest of the JvmSettings. Since 1.2 it's possible to use place holder @BASEDIR@ and @REPO@



  • Type: java.lang.String
  • Required: No

generateRepository:



Set to false to skip repository generation.



  • Type: boolean
  • Required: No
  • Default: true

includeConfigurationDirectoryInClasspath:



configurationDirectory ( etc



  • Type: boolean
  • Required: No
  • Default: true

licenseHeaderFile:



You can define a license header file which will be used instead the default header in the generated scripts.



  • Type: java.io.File
  • Since: 1.2
  • Required: No

platforms:



The default platforms the plugin will generate bin files for. Configure with string values - "all"(default/empty) | "windows" | "unix".



  • Type: java.util.Set
  • Required: No

programs:



The set of Programs that bin files will be generated for.



  • Type: java.util.Set
  • Required: Yes

projectArtifactFirstInClassPath:



etc



  • Type: boolean
  • Since: 1.2.1
  • Required: No
  • Default: false

repositoryLayout:



lib/



  • Type: java.lang.String
  • Required: No
  • Default: default

repositoryName:



Path (relative to assembleDirectory) of the desired output repository.



  • Type: java.lang.String
  • Required: No
  • Default: repo

showConsoleWindow:



Show console window when execute this application. When false, the generated java command runs in background. This works best for Swing application where the command line invocation is not blocked.



  • Type: boolean
  • Required: No
  • Default: true

unixScriptTemplate:



The unix template of the generated script. It can be a file or resource path. If not given, an internal one is used. Use with case since it not guaranteed to be compatible with new plugin release



  • Type: java.lang.String
  • Since: 1.3
  • Required: No
  • Expression: ${unixScriptTemplate}

useAllDependencies:



Deprecated. Use useallProjectDependencies instead.



The following can be used to use all dependencies instead of the default behavior which represents runtime dependencies only.



  • Type: boolean
  • Since: 1.2.1
  • Required: No
  • Default: false

useAllProjectDependencies:



runtime



  • Type: boolean
  • Since: 1.2.3
  • Required: No
  • Default: false

useAsterikClassPath:



Deprecated. Use useWildcardClassPath instead.



Sometimes it happens that you have many dependencies which means in other words having a very long classpath. And sometimes the classpath becomes too long (in particular on Windows based platforms). This option can help in such situation. If you activate that your classpath contains only a classpath wildcard (REPO/*). But be aware that this works only in combination with Java 1.6 and with repositoryLayout flat. Otherwise this configuration will not work.



  • Type: boolean
  • Since: 1.2.2
  • Required: No
  • Default: false

useTimestampInSnapshotFileName:



For those snapshots download from remote repo, replace the timestamp part with "SNAPSHOT" instead



  • Type: boolean
  • Since: 1.3
  • Required: No
  • Default: true

useWildcardClassPath:



Sometimes it happens that you have many dependencies which means in other words having a very long classpath. And sometimes the classpath becomes too long (in particular on Windows based platforms). This option can help in such situation. If you activate that your classpath contains only a classpath wildcard (REPO/*). But be aware that this works only in combination with Java 1.6 and above and with repositoryLayout flat. Otherwise this configuration will not work.



  • Type: boolean
  • Since: 1.2.3
  • Required: No
  • Default: false

windowsScriptTemplate:



The windows template of the generated script. It can be a file or resource path. If not given, an internal one is used. Use with case since it is not guaranteed to be compatible with new plugin release



  • Type: java.lang.String
  • Since: 1.3
  • Required: No
  • Expression: ${unixScriptTemplate}


 

================example

<plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>appassembler-maven-plugin</artifactId>
     <version>1.1.1</version>
     <executions>
      <execution>
       <!-- new gateway start script -->
       <id>new-start-script</id>
       <phase>prepare-package</phase>
       <configuration>
        <assembleDirectory>${project.build.directory}</assembleDirectory>
        <extraJvmArguments>-Xms256m -Xmx512m -Dapp.name=${SERVER_NAME}_svr -Dlogfile=$LOGFILE
        </extraJvmArguments>
        <repositoryName>lib</repositoryName>
        <repositoryLayout>flat</repositoryLayout>
        <configurationDirectory>config</configurationDirectory>
        <copyConfigurationDirectory>false</copyConfigurationDirectory>
        <includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
        <binFileExtensions>
         <unix>.sh</unix>
        </binFileExtensions>
        <platforms>
         <platform>unix</platform>
        </platforms>
        <programs>
         <program>
          <name>start0</name>
          <mainClass>gravity.framework.core.ApplicationContextGateway</mainClass>
          <platforms>
           <platform>windows</platform>
           <platform>unix</platform>
          </platforms>
         </program>
        </programs>
       </configuration>
       <goals>
        <goal>assemble</goal>
       </goals>
      </execution>
     </executions>
    </plugin>