<!--

    Copyright 2011-2021 Erwin Müller <erwin.mueller@anrisoftware.com>

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

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

	<parent>
        <groupId>com.anrisoftware.globalpom</groupId>
		<artifactId>globalpom-installation</artifactId>
    	<version>4.6.1</version>
	</parent>

	<artifactId>globalpom-izpack</artifactId>
	<packaging>pom</packaging>
    <name>Installation :: IzPack</name>
	<description>IzPack installer support. Defines a new property compile-izpack that will bundle and create an IzPack installer Jar file.</description>
    <inceptionYear>2011</inceptionYear>

	<properties>
        <!-- application -->
		<project.custom.app.name>${project.name}</project.custom.app.name>
		<project.custom.app.description></project.custom.app.description>
        <project.custom.app.path>${project.name}</project.custom.app.path>
		<project.custom.app.version>${project.version}</project.custom.app.version>
        <project.custom.app.author.name />
        <project.custom.app.author.email />
        <project.custom.app.mainclass />
        <project.custom.app.organization.url>http://www.anr-institute.com</project.custom.app.organization.url>
		<project.custom.app.copyright>${project.custom.year} ${project.custom.author.name}</project.custom.app.copyright>
        <project.custom.app.icon.unix>etc/application.png</project.custom.app.icon.unix>
        <project.custom.app.icon.windows>etc/application.ico</project.custom.app.icon.windows>
        <project.custom.app.linuxbin>run.sh</project.custom.app.linuxbin>
        <project.custom.app.linuxdebugbin>debug-run.sh</project.custom.app.linuxdebugbin>
        <project.custom.app.windowsbin>${project.custom.app.windowslauncher}</project.custom.app.windowsbin>
        <project.custom.app.windowsdebugbin>${project.custom.app.windowsdebugscript}</project.custom.app.windowsdebugbin>
        <project.custom.app.windowsstartscript>run.bat</project.custom.app.windowsstartscript>
        <project.custom.app.windowsdebugscript>debug-run.bat</project.custom.app.windowsdebugscript>
        <project.custom.app.windowslauncher>${project.custom.launch4j.applauncher.launcherfilename}.exe</project.custom.app.windowslauncher>
        <!-- izpack installer -->
        <project.custom.izpack.version>5.1.3</project.custom.izpack.version>
        <project.custom.izpack.staging.dir>${project.build.directory}/staging</project.custom.izpack.staging.dir>
        <project.custom.izpack.resources.dir>src/main/izpack</project.custom.izpack.resources.dir>
		<project.custom.izpack.gui.resizeable>yes</project.custom.izpack.gui.resizeable>
		<project.custom.izpack.gui.width>536</project.custom.izpack.gui.width>
		<project.custom.izpack.gui.height>428</project.custom.izpack.gui.height>
		<project.custom.izpack.readme>doc/en/readme.txt</project.custom.izpack.readme>
        <project.custom.jre.minversion>${project.custom.source.source}.0</project.custom.jre.minversion>
        <!-- launch4j installer -->
        <project.custom.launch4j.izpack.mainclass>com.izforge.izpack.installer.bootstrap.Installer</project.custom.launch4j.izpack.mainclass>
        <project.custom.launch4j.izpack.preclasspath></project.custom.launch4j.izpack.preclasspath>
        <project.custom.launch4j.install.jarfilename>${project.artifactId}-${project.version}</project.custom.launch4j.install.jarfilename>
        <project.custom.launch4j.install.icon>src/main/izpack/${project.custom.app.icon.windows}</project.custom.launch4j.install.icon>
        <project.custom.launch4j.install.fileversion>1.0.0.0</project.custom.launch4j.install.fileversion>
        <project.custom.launch4j.install.txtfileversion>1.0.0.0</project.custom.launch4j.install.txtfileversion>
        <project.custom.launch4j.install.filedescription>${project.custom.app.description}</project.custom.launch4j.install.filedescription>
        <project.custom.launch4j.install.copyright>${project.custom.app.copyright}</project.custom.launch4j.install.copyright>
        <project.custom.launch4j.install.productversion>1.0.0.0</project.custom.launch4j.install.productversion>
        <project.custom.launch4j.install.txtproductversion>${project.custom.app.version}</project.custom.launch4j.install.txtproductversion>
        <project.custom.launch4j.install.productname>${project.custom.app.name}</project.custom.launch4j.install.productname>
        <project.custom.launch4j.install.originalfilename>${project.custom.launch4j.install.jarfilename}.exe</project.custom.launch4j.install.originalfilename>
        <project.custom.launch4j.install.internalname>${project.custom.launch4j.install.jarfilename}.jar</project.custom.launch4j.install.internalname>
        <!-- launch4j application launcher -->
        <project.custom.launch4j.applauncher.type>gui</project.custom.launch4j.applauncher.type>
        <project.custom.launch4j.applauncher.icon>src/main/izpack/${project.custom.app.icon.windows}</project.custom.launch4j.applauncher.icon>
        <project.custom.launch4j.applauncher.launcherfilename>${project.artifactId}</project.custom.launch4j.applauncher.launcherfilename>
        <project.custom.launch4j.applauncher.jarfilename></project.custom.launch4j.applauncher.jarfilename>
        <project.custom.launch4j.applauncher.commandline></project.custom.launch4j.applauncher.commandline>
        <project.custom.launch4j.applauncher.jreopt>-Dlogback.configurationFile=etc/logback.xml</project.custom.launch4j.applauncher.jreopt>
        <project.custom.launch4j.applauncher.chdir>../..</project.custom.launch4j.applauncher.chdir>
        <project.custom.launch4j.applauncher.stayalive>false</project.custom.launch4j.applauncher.stayalive>
        <project.custom.launch4j.applauncher.fileversion>1.0.0.0</project.custom.launch4j.applauncher.fileversion>
        <project.custom.launch4j.applauncher.txtfileversion>1.0.0.0</project.custom.launch4j.applauncher.txtfileversion>
        <project.custom.launch4j.applauncher.filedescription>${project.custom.app.description}</project.custom.launch4j.applauncher.filedescription>
        <project.custom.launch4j.applauncher.copyright>${project.custom.app.copyright}</project.custom.launch4j.applauncher.copyright>
        <project.custom.launch4j.applauncher.productversion>1.0.0.0</project.custom.launch4j.applauncher.productversion>
        <project.custom.launch4j.applauncher.txtproductversion>${project.custom.app.version}</project.custom.launch4j.applauncher.txtproductversion>
        <project.custom.launch4j.applauncher.productname>${project.custom.app.name}</project.custom.launch4j.applauncher.productname>
        <project.custom.launch4j.applauncher.originalfilename>${project.custom.launch4j.applauncher.jarfilename}.exe</project.custom.launch4j.applauncher.originalfilename>
        <project.custom.launch4j.applauncher.internalname>${project.custom.launch4j.applauncher.jarfilename}.jar</project.custom.launch4j.applauncher.internalname>
        <!-- launch4j uninstall -->
        <project.custom.launch4j.unistaller.filename>uninstaller</project.custom.launch4j.unistaller.filename>
        <project.custom.launch4j.unistaller.mainclass>com.izforge.izpack.uninstaller.Uninstaller</project.custom.launch4j.unistaller.mainclass>
        <project.custom.launch4j.unistaller.jarfile>Uninstaller/uninstaller.jar</project.custom.launch4j.unistaller.jarfile>
        <project.custom.launch4j.unistaller.chdir>..</project.custom.launch4j.unistaller.chdir>
	</properties>

    <issueManagement>
        <system>Redmine</system>
        <url>https://anrisoftware.com/projects/projects/globalpom-groovy-izpack</url>
    </issueManagement>

	<build>

		<plugins>

			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<encoding>${project.build.sourceEncoding}</encoding>
							<outputDirectory>${project.custom.izpack.staging.dir}</outputDirectory>
							<escapeString>\</escapeString>
							<resources>
								<resource>
									<directory>${project.custom.izpack.resources.dir}</directory>
									<filtering>true</filtering>
									<excludes>
                                        <exclude>**/*.svgz</exclude>
										<exclude>**/*.jar</exclude>
										<exclude>**/*.pdf</exclude>
										<exclude>**/*.ico</exclude>
										<exclude>**/*.png</exclude>
									</excludes>
								</resource>
								<resource>
									<directory>${project.custom.izpack.resources.dir}</directory>
									<filtering>false</filtering>
									<includes>
                                        <exclude>**/*.svgz</exclude>
										<include>**/*.jar</include>
										<include>**/*.pdf</include>
										<include>**/*.ico</include>
										<include>**/*.png</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<!-- Maven plugin for IzPack -->
					<groupId>org.codehaus.izpack</groupId>
					<artifactId>izpack-maven-plugin</artifactId>
					<version>${project.custom.izpack.version}</version>
				</plugin>
                <plugin>
                    <!-- Maven plugin for launch4j -->
                    <groupId>com.akathist.maven.plugins.launch4j</groupId>
                    <artifactId>launch4j-maven-plugin</artifactId>
                    <version>1.7.8</version>
                </plugin>
			</plugins>
		</pluginManagement>

	</build>

	<profiles>
		<profile>
			<id>compile-izpack</id>
			<build>
				<plugins>
					<!-- prepare dependencies so that izpack jar tag to pickup at compile
						time -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>standard-installer</id>
								<phase>process-resources</phase>
								<goals>
									<goal>copy-dependencies</goal>
								</goals>
								<configuration>
                                    <includeScope>compile</includeScope>
									<stripVersion>true</stripVersion>
									<!-- don't want the standalone IzPack compiler -->
									<excludeGroupIds>org.codehaus.izpack</excludeGroupIds>
									<outputDirectory>${project.custom.izpack.staging.dir}/lib</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
                        <groupId>org.codehaus.izpack</groupId>
                        <artifactId>izpack-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>izpack</goal>
                                </goals>
                                <configuration>
                                    <baseDir>${project.custom.izpack.staging.dir}</baseDir>
                                    <installFile>${project.custom.izpack.staging.dir}/install.xml</installFile>
                                    <classifier>izpack</classifier>
                                </configuration>
                            </execution>
                        </executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<executions>
							<execution>
								<id>enforce-property</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireProperty>
											<property>project.custom.app.mainclass</property>
											<regex>.+</regex>
											<regexMessage>Property project.custom.app.mainclass must be set. The property cannot be empty.</regexMessage>
										</requireProperty>
										<requireProperty>
											<property>project.custom.app.author.name</property>
											<regex>.+</regex>
											<regexMessage>Property project.custom.app.author.name must be set. The property cannot be empty.</regexMessage>
										</requireProperty>
										<requireProperty>
											<property>project.custom.app.author.email</property>
											<regex>.+</regex>
											<regexMessage>Property project.custom.app.author.email must be set. The property cannot be empty.</regexMessage>
										</requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.organization.url</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.organization.url must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.name must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.linuxbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.linuxbin must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.linuxdebugbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.linuxdebugbin must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.windowsbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.windowsbin must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.windowsdebugbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.windowsdebugbin must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.izpack.gui.resizeable</property>
                                            <regex>(yes|no)</regex>
                                            <regexMessage>Property project.custom.izpack.gui.resizeable must be set to yes|no.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.izpack.gui.resizeable</property>
                                            <regex>(yes|no)</regex>
                                            <regexMessage>Property project.custom.izpack.gui.resizeable must be set to yes|no.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.izpack.gui.width</property>
                                            <regex>\d+</regex>
                                            <regexMessage>Property project.custom.izpack.gui.width must be set to an valid size.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.izpack.gui.height</property>
                                            <regex>\d+</regex>
                                            <regexMessage>Property project.custom.izpack.gui.height must be set to an valid size.</regexMessage>
                                        </requireProperty>
									</rules>
									<fail>true</fail>
								</configuration>
							</execution>
						</executions>
					</plugin>

				</plugins>
			</build>
		</profile>

        <profile>
            <id>make-install-exe</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.akathist.maven.plugins.launch4j</groupId>
                        <artifactId>launch4j-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>l4j</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>launch4j</goal>
                                </goals>
                                <configuration>
                                    <headerType>gui</headerType>
                                    <outfile>target/${project.custom.launch4j.install.jarfilename}.exe</outfile>
                                    <jar>target/${project.custom.launch4j.install.jarfilename}.jar</jar>
                                    <errTitle>${project.custom.launch4j.install.jarfilename}</errTitle>
                                    <classPath>
                                        <mainClass>${project.custom.launch4j.izpack.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                        <preCp>${project.custom.launch4j.izpack.preclasspath}</preCp>
                                    </classPath>
                                    <icon>${project.custom.launch4j.install.icon}</icon>
                                    <jre>
                                        <minVersion>${project.custom.jre.minversion}</minVersion>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${project.custom.launch4j.install.fileversion}</fileVersion>
                                        <txtFileVersion>${project.custom.launch4j.install.txtfileversion}</txtFileVersion>
                                        <fileDescription>${project.custom.launch4j.install.filedescription}</fileDescription>
                                        <copyright>${project.custom.launch4j.install.copyright}</copyright>
                                        <productVersion>${project.custom.launch4j.install.productversion}</productVersion>
                                        <txtProductVersion>${project.custom.launch4j.install.txtproductversion}</txtProductVersion>
                                        <productName>${project.custom.launch4j.install.productname}</productName>
                                        <internalName>${project.custom.launch4j.install.internalname}</internalName>
                                        <originalFilename>${project.custom.launch4j.install.originalfilename}</originalFilename>
                                    </versionInfo>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-property</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireProperty>
                                            <property>project.custom.app.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.mainclass must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.author.name must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.author.email must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.install.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.install.filedescription must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.install.originalfilename</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property project.custom.launch4j.install.originalfilename must be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.install.internalname</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property project.custom.launch4j.install.internalname must be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.izpack.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.izpack.mainclass must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireFilesExist>
                                            <files>
                                                <file>target/${project.custom.launch4j.install.jarfilename}.jar</file>
                                            </files>
                                            <message>File target/${project.custom.launch4j.install.jarfilename}.jar must exists. Run profile compile-izpack first.</message>
                                        </requireFilesExist>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>make-launcher-exe</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.akathist.maven.plugins.launch4j</groupId>
                        <artifactId>launch4j-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>l4j</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>launch4j</goal>
                                </goals>
                                <configuration>
                                    <headerType>${project.custom.launch4j.applauncher.type}</headerType>
                                    <outfile>target/${project.custom.launch4j.applauncher.launcherfilename}.exe</outfile>
                                    <jar>lib/${project.custom.launch4j.applauncher.jarfilename}.jar</jar>
                                    <errTitle>${project.custom.launch4j.applauncher.jarfilename}</errTitle>
                                    <dontWrapJar>true</dontWrapJar>
                                    <cmdLine>${project.custom.launch4j.applauncher.commandline}</cmdLine>
                                    <chdir>${project.custom.launch4j.applauncher.chdir}</chdir>
                                    <stayAlive>${project.custom.launch4j.applauncher.stayalive}</stayAlive>
                                    <classPath>
                                        <mainClass>${project.custom.app.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                        <preCp>lib/*.jar</preCp>
                                    </classPath>
                                    <icon>${project.custom.launch4j.applauncher.icon}</icon>
                                    <jre>
                                        <minVersion>${project.custom.jre.minversion}</minVersion>
                                        <opts>
                                            <opt>${project.custom.launch4j.applauncher.jreopt}</opt>
                                        </opts>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${project.custom.launch4j.applauncher.fileversion}</fileVersion>
                                        <txtFileVersion>${project.custom.launch4j.applauncher.txtfileversion}</txtFileVersion>
                                        <fileDescription>${project.custom.launch4j.applauncher.filedescription}</fileDescription>
                                        <copyright>${project.custom.launch4j.applauncher.copyright}</copyright>
                                        <productVersion>${project.custom.launch4j.applauncher.productversion}</productVersion>
                                        <txtProductVersion>${project.custom.launch4j.applauncher.txtproductversion}</txtProductVersion>
                                        <productName>${project.custom.launch4j.applauncher.productname}</productName>
                                        <internalName>${project.custom.launch4j.applauncher.internalname}</internalName>
                                        <originalFilename>${project.custom.launch4j.applauncher.originalfilename}</originalFilename>
                                    </versionInfo>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-property</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireProperty>
                                            <property>project.custom.app.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.mainclass must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.author.name must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.author.email must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.applauncher.type</property>
                                            <regex>gui|console</regex>
                                            <regexMessage>Property project.custom.launch4j.applauncher.type must be set. Property must be either "gui" or "console".</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.applauncher.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.applauncher.filedescription must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.applauncher.originalfilename</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property project.custom.launch4j.applauncher.originalfilename must be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.applauncher.internalname</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property project.custom.launch4j.applauncher.internalname must be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.applauncher.launcherfilename</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.applauncher.launcherfilename must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.applauncher.jarfilename</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.applauncher.jarfilename must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>make-uninstall-exe</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.akathist.maven.plugins.launch4j</groupId>
                        <artifactId>launch4j-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>l4j</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>launch4j</goal>
                                </goals>
                                <configuration>
                                    <headerType>gui</headerType>
                                    <outfile>target/${project.custom.launch4j.unistaller.filename}.exe</outfile>
                                    <jar>${project.custom.launch4j.unistaller.jarfile}</jar>
                                    <errTitle>${project.custom.launch4j.unistaller.jarfile}</errTitle>
                                    <dontWrapJar>true</dontWrapJar>
                                    <chdir>${project.custom.launch4j.unistaller.chdir}</chdir>
                                    <classPath>
                                        <mainClass>${project.custom.launch4j.unistaller.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                    </classPath>
                                    <icon>${project.custom.launch4j.applauncher.icon}</icon>
                                    <jre>
                                        <minVersion>${project.custom.jre.minversion}</minVersion>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${project.custom.launch4j.applauncher.fileversion}</fileVersion>
                                        <txtFileVersion>${project.custom.launch4j.applauncher.txtfileversion}</txtFileVersion>
                                        <fileDescription>${project.custom.launch4j.applauncher.filedescription}</fileDescription>
                                        <copyright>${project.custom.launch4j.applauncher.copyright}</copyright>
                                        <productVersion>${project.custom.launch4j.applauncher.productversion}</productVersion>
                                        <txtProductVersion>${project.custom.launch4j.applauncher.txtproductversion}</txtProductVersion>
                                        <productName>${project.custom.launch4j.applauncher.productname}</productName>
                                        <internalName>${project.custom.launch4j.unistaller.jarfile}</internalName>
                                        <originalFilename>${project.custom.launch4j.unistaller.filename}.exe</originalFilename>
                                    </versionInfo>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-property</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireProperty>
                                            <property>project.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.author.name must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.app.author.email must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.unistaller.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.unsintaller.mainclass must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.unistaller.filename</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.unistaller.filename must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.unistaller.jarfile</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.unistaller.jarfile must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.applauncher.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.applauncher.filedescription must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

	</profiles>

</project>
