Commits

Micha Kops committed fda0e49

Initial import.

  • Participants

Comments (0)

Files changed (5)

+target
+.settings
+.project
+.classpath
+# Launch4j Maven Plugin Example #
+
+A simple example how to create a windows executable *.exe for your runnable Jar file using Maven and Launch4j.
+
+<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/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.hascode.tutorial</groupId>
+	<artifactId>launch4j-maven-sample</artifactId>
+	<version>0.0.1</version>
+	<name>hasCode Launch4j Maven Example</name>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-shade-plugin</artifactId>
+				<version>1.7</version>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<goals>
+							<goal>shade</goal>
+						</goals>
+					</execution>
+				</executions>
+				<configuration>
+					<shadedArtifactAttached>true</shadedArtifactAttached>
+					<shadedClassifierName>shaded</shadedClassifierName>
+				</configuration>
+			</plugin>
+
+			<plugin>
+				<groupId>org.bluestemsoftware.open.maven.plugin</groupId>
+				<artifactId>launch4j-plugin</artifactId>
+				<version>1.5.0.0</version>
+				<executions>
+					<execution>
+						<id>l4j-gui</id>
+						<phase>package</phase>
+						<goals>
+							<goal>launch4j</goal>
+						</goals>
+						<configuration>
+							<headerType>gui</headerType>
+							<outfile>target/Application.exe</outfile>
+							<jar>target/${artifactId}-${version}-shaded.jar</jar>
+							<errTitle>Application Error</errTitle>
+							<classPath>
+								<mainClass>com.hascode.tutorial.Main</mainClass>
+							</classPath>
+							<icon>src/main/resources/icon/application.ico</icon>
+							<jre>
+								<minVersion>1.5.0</minVersion>
+								<maxVersion>1.7.0</maxVersion>
+								<initialHeapSize>128</initialHeapSize>
+								<maxHeapSize>1024</maxHeapSize>
+							</jre>
+							<versionInfo>
+								<fileVersion>1.0.0.0</fileVersion>
+								<txtFileVersion>1.0.0.0</txtFileVersion>
+								<fileDescription>${project.name}</fileDescription>
+								<copyright>2012 hasCode.com</copyright>
+								<productVersion>1.0.0.0</productVersion>
+								<txtProductVersion>1.0.0.0</txtProductVersion>
+								<productName>${project.name}</productName>
+								<internalName>${project.name}</internalName>
+								<originalFilename>Application.exe</originalFilename>
+							</versionInfo>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

File src/main/java/com/hascode/tutorial/Main.java

+package com.hascode.tutorial;
+
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+
+public class Main extends JDialog {
+	private static final long serialVersionUID = 1L;
+	private final JColorChooser cc;
+
+	public Main() {
+		setSize(800, 600);
+		setTitle("hasCode.com launch4j Maven Tutorial");
+		cc = new JColorChooser();
+		add(cc);
+		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+		setVisible(true);
+	}
+
+	public static void main(final String[] args) {
+		new Main();
+	}
+
+}

File src/main/resources/icon/application.ico

Added
New image