<!--

    Copyright 2011-2022 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.2</version>
    </parent>

    <artifactId>globalpom-izpack-singlejar</artifactId>
    <packaging>pom</packaging>
    <name>Installation :: IzPack :: Single Jar</name>
    <description>IzPack installer support. Bundle and create an IzPack installer Jar file. The application is bundled in a single Jar file.</description>
    <inceptionYear>2011</inceptionYear>
    <url>https://anrisoftware.com/projects/projects/globalpom-groovy-izpack-singlejar</url>

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

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

    <scm>
        <connection>${globalpom.custom.scm.pub}</connection>
        <developerConnection>${globalpom.custom.scm.dev}</developerConnection>
        <url>${globalpom.custom.scm.url}</url>
        <tag>HEAD</tag>
    </scm>

    <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>${globalpom.custom.izpack.staging.dir}</outputDirectory>
                            <escapeString>\</escapeString>
                            <resources>
                                <resource>
                                    <directory>${globalpom.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>${globalpom.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>${globalpom.custom.izpack.version}</version>
                </plugin>
                <plugin>
                    <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.2.4</version>
                        <executions>
                            <execution>
                                <id>shade-my-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <shadedArtifactAttached>true</shadedArtifactAttached>
                                    <shadedClassifierName>allinone</shadedClassifierName>
                                    <artifactSet>
                                        <includes>
                                            <include>*:*</include>
                                        </includes>
                                    </artifactSet>
                                    <filters>
                                        <filter>
                                            <artifact>*:*</artifact>
                                            <excludes>
                                                <exclude>META-INF/*.SF</exclude>
                                                <exclude>META-INF/*.DSA</exclude>
                                                <exclude>META-INF/*.RSA</exclude>
                                            </excludes>
                                        </filter>
                                    </filters>
                                    <transformers>
                                        <transformer
                                            implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>reference.conf</resource>
                                        </transformer>
                                        <transformer
                                            implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>version.conf</resource>
                                        </transformer>
                                        <transformer
                                            implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                            <manifestEntries>
                                                <Main-Class>${globalpom.custom.app.mainclass}</Main-Class>
                                            </manifestEntries>
                                        </transformer>
                                    </transformers>
                                </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>${globalpom.custom.izpack.staging.dir}</baseDir>
                                    <installFile>${globalpom.custom.izpack.staging.dir}/install.xml</installFile>
                                    <mkdirs>true</mkdirs>
                                    <classifier>install</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>globalpom.custom.app.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.mainclass must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.name must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.email must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.organization.url</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.organization.url must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.name must be set. The property
                                                cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.linuxbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.linuxbin must be set. The property
                                                cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.linuxdebugbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.linuxdebugbin must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.windowsbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.windowsbin must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.windowsdebugbin</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.windowsdebugbin must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.izpack.gui.resizeable</property>
                                            <regex>(yes|no)</regex>
                                            <regexMessage>Property globalpom.custom.izpack.gui.resizeable must be set to
                                                yes|no.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.izpack.gui.resizeable</property>
                                            <regex>(yes|no)</regex>
                                            <regexMessage>Property globalpom.custom.izpack.gui.resizeable must be set to
                                                yes|no.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.izpack.gui.width</property>
                                            <regex>\d+</regex>
                                            <regexMessage>Property globalpom.custom.izpack.gui.width must be set to an
                                                valid size.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.izpack.gui.height</property>
                                            <regex>\d+</regex>
                                            <regexMessage>Property globalpom.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/${globalpom.custom.launch4j.install.jarfilename}.exe</outfile>
                                    <jar>target/${globalpom.custom.launch4j.install.jarfilename}.jar</jar>
                                    <errTitle>${globalpom.custom.launch4j.install.jarfilename}</errTitle>
                                    <classPath>
                                        <mainClass>${globalpom.custom.launch4j.izpack.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                        <preCp>${globalpom.custom.launch4j.izpack.preclasspath}</preCp>
                                    </classPath>
                                    <icon>${globalpom.custom.launch4j.install.icon}</icon>
                                    <jre>
                                        <minVersion>${globalpom.custom.jre.minversion}</minVersion>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${globalpom.custom.launch4j.install.fileversion}</fileVersion>
                                        <txtFileVersion>${globalpom.custom.launch4j.install.txtfileversion}</txtFileVersion>
                                        <fileDescription>${globalpom.custom.launch4j.install.filedescription}</fileDescription>
                                        <copyright>${globalpom.custom.launch4j.install.copyright}</copyright>
                                        <productVersion>${globalpom.custom.launch4j.install.productversion}</productVersion>
                                        <txtProductVersion>${globalpom.custom.launch4j.install.txtproductversion}</txtProductVersion>
                                        <productName>${globalpom.custom.launch4j.install.productname}</productName>
                                        <internalName>${globalpom.custom.launch4j.install.internalname}</internalName>
                                        <originalFilename>${globalpom.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>globalpom.custom.app.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.mainclass must be set. The property
                                                cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.author.name must be set. The property
                                                cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.author.email must be set. The property
                                                cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.install.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.install.filedescription must
                                                be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.install.originalfilename</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.install.originalfilename must
                                                be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.install.internalname</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.install.internalname must be
                                                set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.izpack.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.izpack.mainclass must be set.
                                                The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireFilesExist>
                                            <files>
                                                <file>target/${globalpom.custom.launch4j.install.jarfilename}.jar</file>
                                            </files>
                                            <message>File target/${globalpom.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-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>${globalpom.custom.launch4j.app.type}</headerType>
                                    <outfile>target/${globalpom.custom.launch4j.app.filename}.exe</outfile>
                                    <jar>target/${globalpom.custom.launch4j.app.jarfilename}.jar</jar>
                                    <errTitle>${globalpom.custom.launch4j.app.jarfilename}</errTitle>
                                    <classPath>
                                        <mainClass>${globalpom.custom.app.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                        <preCp>${globalpom.custom.app.preclasspath}</preCp>
                                    </classPath>
                                    <icon>${globalpom.custom.launch4j.app.icon}</icon>
                                    <jre>
                                        <minVersion>${globalpom.custom.jre.minversion}</minVersion>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${globalpom.custom.launch4j.app.fileversion}</fileVersion>
                                        <txtFileVersion>${globalpom.custom.launch4j.app.txtfileversion}</txtFileVersion>
                                        <fileDescription>${globalpom.custom.launch4j.app.filedescription}</fileDescription>
                                        <copyright>${globalpom.custom.launch4j.app.copyright}</copyright>
                                        <productVersion>${globalpom.custom.launch4j.app.productversion}</productVersion>
                                        <txtProductVersion>${globalpom.custom.launch4j.app.txtproductversion}</txtProductVersion>
                                        <productName>${globalpom.custom.launch4j.app.productname}</productName>
                                        <internalName>${globalpom.custom.launch4j.app.internalname}</internalName>
                                        <originalFilename>${globalpom.custom.launch4j.app.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>globalpom.custom.app.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.mainclass must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.name must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.email must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.app.type</property>
                                            <regex>gui|console</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.app.type must be set.
                                                Property must be either "gui" or "cli".</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.app.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.app.filedescription must be
                                                set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.app.originalfilename</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.app.originalfilename must be
                                                set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.app.internalname</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.app.internalname must be set.
                                                It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireFilesExist>
                                            <files>
                                                <file>target/${globalpom.custom.app.jarfilename}.jar</file>
                                            </files>
                                            <message>File target/${globalpom.custom.app.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>${globalpom.custom.launch4j.applauncher.type}</headerType>
                                    <outfile>target/${globalpom.custom.launch4j.applauncher.launcherfilename}.exe</outfile>
                                    <jar>lib/${globalpom.custom.launch4j.applauncher.jarfilename}.jar</jar>
                                    <errTitle>${globalpom.custom.launch4j.applauncher.jarfilename}</errTitle>
                                    <dontWrapJar>true</dontWrapJar>
                                    <cmdLine>${globalpom.custom.launch4j.applauncher.commandline}</cmdLine>
                                    <chdir>${globalpom.custom.launch4j.applauncher.chdir}</chdir>
                                    <stayAlive>${globalpom.custom.launch4j.applauncher.stayalive}</stayAlive>
                                    <classPath>
                                        <mainClass>${globalpom.custom.app.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                        <preCp>lib/*.jar</preCp>
                                    </classPath>
                                    <icon>${globalpom.custom.launch4j.applauncher.icon}</icon>
                                    <jre>
                                        <minVersion>${globalpom.custom.jre.minversion}</minVersion>
                                        <opts>
                                            <opt>${globalpom.custom.launch4j.applauncher.jreopt}</opt>
                                        </opts>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${globalpom.custom.launch4j.applauncher.fileversion}</fileVersion>
                                        <txtFileVersion>${globalpom.custom.launch4j.applauncher.txtfileversion}</txtFileVersion>
                                        <fileDescription>${globalpom.custom.launch4j.applauncher.filedescription}</fileDescription>
                                        <copyright>${globalpom.custom.launch4j.applauncher.copyright}</copyright>
                                        <productVersion>${globalpom.custom.launch4j.applauncher.productversion}</productVersion>
                                        <txtProductVersion>${globalpom.custom.launch4j.applauncher.txtproductversion}</txtProductVersion>
                                        <productName>${globalpom.custom.launch4j.applauncher.productname}</productName>
                                        <internalName>${globalpom.custom.launch4j.applauncher.internalname}</internalName>
                                        <originalFilename>${globalpom.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>globalpom.custom.app.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.mainclass must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.name must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.email must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.applauncher.type</property>
                                            <regex>gui|console</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.applauncher.type must be set.
                                                Property must be either "gui" or "console".</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.applauncher.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.applauncher.filedescription
                                                must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.applauncher.originalfilename</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.applauncher.originalfilename
                                                must be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.applauncher.internalname</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.applauncher.internalname must
                                                be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.applauncher.launcherfilename</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.applauncher.launcherfilename
                                                must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.applauncher.jarfilename</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.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/${globalpom.custom.launch4j.unistaller.filename}.exe</outfile>
                                    <jar>${globalpom.custom.launch4j.unistaller.jarfile}</jar>
                                    <errTitle>${globalpom.custom.launch4j.unistaller.jarfile}</errTitle>
                                    <dontWrapJar>true</dontWrapJar>
                                    <chdir>${globalpom.custom.launch4j.unistaller.chdir}</chdir>
                                    <classPath>
                                        <mainClass>${globalpom.custom.launch4j.unistaller.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                    </classPath>
                                    <icon>${globalpom.custom.launch4j.app.icon}</icon>
                                    <jre>
                                        <minVersion>${globalpom.custom.jre.minversion}</minVersion>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${globalpom.custom.launch4j.app.fileversion}</fileVersion>
                                        <txtFileVersion>${globalpom.custom.launch4j.app.txtfileversion}</txtFileVersion>
                                        <fileDescription>${globalpom.custom.launch4j.app.filedescription}</fileDescription>
                                        <copyright>${globalpom.custom.launch4j.app.copyright}</copyright>
                                        <productVersion>${globalpom.custom.launch4j.app.productversion}</productVersion>
                                        <txtProductVersion>${globalpom.custom.launch4j.app.txtproductversion}</txtProductVersion>
                                        <productName>${globalpom.custom.launch4j.app.productname}</productName>
                                        <internalName>${globalpom.custom.launch4j.unistaller.jarfile}</internalName>
                                        <originalFilename>${globalpom.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>globalpom.custom.app.author.name</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.name must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.app.author.email</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.app.author.email must be set. The
                                                property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.unistaller.mainclass</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.unsintaller.mainclass must be
                                                set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.unistaller.filename</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.unistaller.filename must be
                                                set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.unistaller.jarfile</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.unistaller.jarfile must be
                                                set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>globalpom.custom.launch4j.app.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property globalpom.custom.launch4j.app.filedescription must be
                                                set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

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

    </profiles>

</project>
