The following configuration will generate a daemon daemon-1 and daemon-1.bat script within the ${project.build.directory}/generated-resources/appassembler/jsw/daemon-1/bin/ folder.
<project> ... <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>appassembler-maven-plugin</artifactId> <version>1.10</version> <executions> <execution> <phase>package</phase> <goals> <goal>generate-daemons</goal> </goals> </execution> </executions> <configuration> <daemons> <daemon> <id>daemon-1</id> <mainClass>com.westerngeco.example.App</mainClass> <platforms> <platform>jsw</platform> </platforms> </daemon> </daemons> </configuration> </plugin> </plugins> </build> </project>
Furthermore it will create a conf folder in ${project.build.directory}/generated-resources/appassembler/jsw/daemon-1/ where a file called wrapper.conf is located. Last but not least within the ${project.build.directory}/generated-resources/appassembler/jsw/daemon-1/ folder will contain the following parts:
The folder structure under lib will look like this:
. |-- libwrapper-linux-x86-32.so |-- libwrapper-macosx-universal-32.jnilib |-- libwrapper-solaris-x86-32.so |-- org | `-- codehaus | `-- mojo | `-- appassembler | `-- daemonTest | |-- 1.0-SNAPSHOT | | |-- daemonTest-1.0-SNAPSHOT.jar | | `-- maven-metadata-appassembler.xml | `-- maven-metadata-appassembler.xml |-- wrapper.jar `-- wrapper-windows-x86-32.dll
The following will give you an impression what has been created under the daemon-1 folder during the generation process.
. `-- daemon-1 |-- bin | |-- daemon-1 | |-- daemon-1.bat | |-- wrapper-linux-x86-32 | |-- wrapper-macosx-universal-32 | |-- wrapper-solaris-x86-32 | `-- wrapper-windows-x86-32.exe |-- conf | `-- wrapper.conf `-- lib |-- libwrapper-linux-x86-32.so |-- libwrapper-macosx-universal-32.jnilib |-- libwrapper-solaris-x86-32.so |-- org | `-- codehaus | `-- mojo | `-- appassembler | `-- daemonTest | |-- 1.0-SNAPSHOT | | |-- daemonTest-1.0-SNAPSHOT.jar | | `-- maven-metadata-appassembler.xml | `-- maven-metadata-appassembler.xml |-- wrapper.jar `-- wrapper-windows-x86-32.dll
Suppose you have created two classes for which you like to create two separate scripts. This can simply be achieved by using the following configuration. There is no limitation how many scripts you can generate through a configuration like this.
<project> ... <build> <plugins> ... <configuration> <daemons> <daemon> <id>daemon-1</id> <mainClass>com.westerngeco.example.App1</mainClass> <platforms> <platform>jsw</platform> </platforms> </daemon> <daemon> <id>daemon-2</id> <mainClass>com.westerngeco.example.App2</mainClass> <platforms> <platform>jsw</platform> </platforms> </daemon> </daemons> </configuration> </plugin> ... </plugins> </build> </project>
The result of such an configuration will be that under ${project.build.directory}/generated-resources/appassembler/jsw/daemon-1/ and ${project.build.directory}/generated-resources/appassembler/jsw/daemon-2/ a folder structure like the following will be created for each of the id-entries.
. `-- daemon-1 |-- bin | |-- daemon-1 | |-- daemon-1.bat | |-- wrapper-linux-x86-32 | |-- wrapper-macosx-universal-32 | |-- wrapper-solaris-x86-32 | `-- wrapper-windows-x86-32.exe |-- conf | `-- wrapper.conf `-- lib |-- libwrapper-linux-x86-32.so |-- libwrapper-macosx-universal-32.jnilib |-- libwrapper-solaris-x86-32.so |-- org | `-- codehaus | `-- mojo | `-- appassembler | `-- daemonTest | |-- 1.0-SNAPSHOT | | |-- daemonTest-1.0-SNAPSHOT.jar | | `-- maven-metadata-appassembler.xml | `-- maven-metadata-appassembler.xml |-- wrapper.jar `-- wrapper-windows-x86-32.dll