This is a walkthrough of the "myapp" example project. The example project lives with the main
solaris-maven-plugin in subversion and you can find the latest version
in Subversion
.
The example project consists of four parts:
myapp - The parent POM for all of the modules.
myapp-core - The implementation part of the project. This contains a pure Java server.
myapp-server - The command line interface part of the server. This build will result in both a
JAR file containing the source code and a myapp-server-<version>.tar.gz.
myapp-pkg - A System V package that delivers the binary application.
The parent project is pretty small, it only contains references to the other child modules. As the plugin only works on Solaris the two package modules are placed in a separate profile that is automatically included when running on Solaris.
The core project is even smaller than the parent project, it does not use anything from the solaris plugin at all. It is simply a normal Maven project that will result in a JAR.
The server project is a complete distribution of an application. It will result in a tarball that is in itself usable, but it will also be used when packaging the server.
The first plugin to run is the Appassembler plugin. This plugin will generate the shell scripts that are used to launch the application.
The second plugin to execute is the assembly plugin. It will copy all the required artifacts and put them into the tarball. In addition to creating the tarball it will also assemble the entire application into a directory. This directory has the exact same layout as the tarball and can be used to test the application directly from a Maven build area.
By using the attached-inline goal the assembly will be created and attached to the build when we
run mvn install.
The "pkg" project is the Maven project actually producing the .pkg file. There are two key
points required to do this:
packaging element of the POM to solarissolaris-maven-plugin and tell Maven that the plugin contain
extensions.
That is all that is required to create a complete but not very useful package.