maven-japplication-plugin

Version 25.1 by Andrus Adamchik on 2006/09/30 19:16

Description

"maven-japplication-plugin" is a plugin for assembling native launchers of Java applications for a number of target platforms. Current project artifact and all its declared and transitive dependencies will be bundled into the launcher. Currently supports native launchers for Mac and Windows operating systems and also a "java launcher" - a single jar file that can be run via "java jar file.jar". 

"maven-japplication-plugin" is based on a JApplication Ant task and has similar capabilities, however the Maven environment provides more information about the project, so plugin has fewer required parameters.

Prerequisites

Prerequisites and OS requirements are similar to those for JApplication Ant task. In particular for Windows you will need to install NSIS.

Goals

org.objectstyle.woproject.maven2:japplication:japplication

"japplication" is the only defined goal. Its purpose is to assemble a java launcher. It has the parameters described below. The difference from JApplication Ant task is in smarter defaults. 

ParameterDescriptionRequiredDefaultPlatforms
nameThe name of the application without OS-specific extensionNo$project.artifact.artifactId 
mainClassMain Java classYes  
osA family of operating systems. Currently supported values are "mac", "windows" and "java"NoBuild machine OS, if omitted; if the os is not supported, will use "java". 
destDirA destination directory where the application launcher should be installedNo$project.build.directory(usually "target/") 
longNameAn optional string identifying the application human-readable name. If not specified, "name" is used.No$project.artifact.artifactId-$project.artifact.version 
iconPlatform-specific icon file (usually ".ico" on Windows and ".icns" on Mac)nomac,windows
jvmMinimal version of the Java Virtual machine required.no (default is "1.4+")mac
jvmOptionsOptional parameters to pass to the JVM, such as memory settings, etc.nomac,windows
nsisHomeLocation of NSIS installation. Ignored except on Windows.no (default is "C:rogram FilesSIS")windows
versionProduct version stringno (default 0.0)mac

Examples

A POM that builds a Foo application on Mac. All declared and transitive dependencies (not shown here) will be included in Foo.app automatically:

pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

...
<build>
<plugins>
<plugin>
<groupId>org.objectstyle.woproject.maven2</groupId>
<artifactId>maven-japplication-plugin</artifactId>
<configuration>
<name>Foo</name>
<mainClass>org.example.foo.Main</mainClass>
<os>mac</os>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>japplication</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>