Source

launch4j-maven-example / pom.xml

<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>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.5.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>1.7.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<shadedArtifactAttached>true</shadedArtifactAttached>
					<shadedClassifierName>shaded</shadedClassifierName>
					<transformers>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<mainClass>com.hascode.tutorial.Main</mainClass>
						</transformer>
					</transformers>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.akathist.maven.plugins.launch4j</groupId>
				<artifactId>launch4j-maven-plugin</artifactId>
				<version>1.5.1</version>
				<executions>
					<execution>
						<id>l4j-clui</id>
						<phase>package</phase>
						<goals>
							<goal>launch4j</goal>
						</goals>
						<configuration>
							<headerType>gui</headerType>
							<jar>${project.build.directory}/${artifactId}-${version}-shaded.jar</jar>
							<outfile>${project.build.directory}/hasCode.exe</outfile>
							<downloadUrl>http://java.com/download</downloadUrl>
							<classPath>
								<mainClass>com.hascode.tutorial.Main</mainClass>
								<preCp>anything</preCp>
							</classPath>
							<icon>src/main/resources/icon/application.ico</icon>
							<jre>
								<minVersion>1.6.0</minVersion>
								<jdkPreference>preferJre</jdkPreference>
							</jre>
							<versionInfo>
								<fileVersion>1.0.0.0</fileVersion>
								<txtFileVersion>${project.version}</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>
								<companyName>hasCode.com</companyName>
								<internalName>hasCode</internalName>
								<originalFilename>hasCode.exe</originalFilename>
							</versionInfo>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>