<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>
		<artifactId>globalpom-parent</artifactId>
		<groupId>com.anrisoftware.globalpom</groupId>
		<version>1.39</version>
		<relativePath />
	</parent>

	<artifactId>globalpom-izpack-singlejar</artifactId>
	<packaging>pom</packaging>
	<name>Installation :: IzPack :: Single Jar</name>
	<version>2.7-rc4</version>
	<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>
        <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.preclasspath></project.custom.app.preclasspath>
        <project.custom.app.organization.url>http://www.anr-institute.com</project.custom.app.organization.url>
        <project.custom.app.copyright>${project.custom.year} ${project.custom.user.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>run.bat</project.custom.app.windowsbin>
        <project.custom.app.windowsdebugbin>debug-run.bat</project.custom.app.windowsdebugbin>
        <project.custom.app.type>gui</project.custom.app.type>
        <project.custom.app.jarfilename>${project.artifactId}-${project.version}-single-jar</project.custom.app.jarfilename>
        <project.custom.izpack.version>5.0.0-rc4</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.izpack.jarfilename>${project.artifactId}-${project.version}</project.custom.izpack.jarfilename>
		<project.custom.izpack.mainclass>com.izforge.izpack.installer.bootstrap.Installer</project.custom.izpack.mainclass>
		<project.custom.izpack.preclasspath></project.custom.izpack.preclasspath>
		<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.app.jarfilename}.exe</project.custom.launch4j.install.originalfilename>
		<project.custom.launch4j.install.internalname>${project.custom.app.jarfilename}.jar</project.custom.launch4j.install.internalname>
        <project.custom.launch4j.app.icon>src/main/izpack/${project.custom.app.icon.windows}</project.custom.launch4j.app.icon>
        <project.custom.launch4j.app.fileversion>1.0.0.0</project.custom.launch4j.app.fileversion>
        <project.custom.launch4j.app.txtfileversion>1.0.0.0</project.custom.launch4j.app.txtfileversion>
        <project.custom.launch4j.app.filedescription>${project.custom.app.description}</project.custom.launch4j.app.filedescription>
        <project.custom.launch4j.app.copyright>${project.custom.app.copyright}</project.custom.launch4j.app.copyright>
        <project.custom.launch4j.app.productversion>1.0.0.0</project.custom.launch4j.app.productversion>
        <project.custom.launch4j.app.txtproductversion>${project.custom.app.version}</project.custom.launch4j.app.txtproductversion>
        <project.custom.launch4j.app.productname>${project.custom.app.name}</project.custom.launch4j.app.productname>
        <project.custom.launch4j.app.originalfilename>${project.custom.app.jarfilename}.exe</project.custom.launch4j.app.originalfilename>
        <project.custom.launch4j.app.internalname>${project.custom.app.jarfilename}.jar</project.custom.launch4j.app.internalname>
        <project.custom.jre.minversion>${project.custom.source.source}.0</project.custom.jre.minversion>
        <project.custom.singlejar_assembly.version>1.5</project.custom.singlejar_assembly.version>
	</properties>

	<licenses>
		<license>
			<name>LGPLv3</name>
			<url>http://www.gnu.org/licenses/lgpl.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
        <developer>
            <id>EM</id>
            <name>Erwin Müller</name>
            <email>erwin.mueller@deventm.org</email>
            <timezone>Europe/Berlin</timezone>
            <organization>Advanced Natural Research Institute</organization>
            <organizationUrl>https://anrisoftware.com</organizationUrl>
            <roles>
                <role>Owner</role>
                <role>Developer</role>
            </roles>
        </developer>
	</developers>

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

    <scm>
        <connection>scm:git:git@anrisoftware.com:globalpom-installation.git</connection>
        <developerConnection>scm:git:git@anrisoftware.com:globalpom-installation.git</developerConnection>
        <url>https://anrisoftware.com/projects/projects/globalpom-izpack-singlejar/repository</url>
    </scm>

    <distributionManagement>
        <site>
            <id>anrisoftware</id>
            <url>dav:https://anrisoftware.com/javadoc/${project.groupId}/${project.artifactId}</url>
        </site>
        <repository>
            <id>osssonatype</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>osssonatype_snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

	<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>**/*.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>
										<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>
                <groupId>com.akathist.maven.plugins.launch4j</groupId>
                <artifactId>launch4j-maven-plugin</artifactId>
                <version>1.7.6</version>
            </plugin>
		</plugins>
	</pluginManagement>

	</build>

	<profiles>
		<profile>
			<id>compile-izpack</id>
			<build>
				<plugins>
		            <plugin>
		                <groupId>org.apache.maven.plugins</groupId>
		                <artifactId>maven-assembly-plugin</artifactId>
		                <dependencies>
		                    <dependency>
		                        <groupId>com.anrisoftware.globalpom</groupId>
		                        <artifactId>globalpom-izpack-singlejar-assembly</artifactId>
		                        <version>${project.custom.singlejar_assembly.version}</version>
		                    </dependency>
		                </dependencies>
		                <configuration>
		                    <archive>
		                        <manifest>
		                            <mainClass>${project.custom.app.mainclass}</mainClass>
		                        </manifest>
		                    </archive>
		                    <descriptorRefs>
		                        <descriptorRef>single-jar</descriptorRef>
		                    </descriptorRefs>
		                </configuration>
		                <executions>
		                    <execution>
		                        <id>make-my-jar-with-dependencies</id>
		                        <phase>package</phase>
		                        <goals>
		                            <goal>single</goal>
		                        </goals>
		                    </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>
									<descriptorEncoding>${project.build.sourceEncoding}</descriptorEncoding>
								</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>
									</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.izpack.jarfilename}.exe</outfile>
									<jar>target/${project.custom.izpack.jarfilename}.jar</jar>
									<errTitle>${project.custom.izpack.jarfilename}</errTitle>
									<classPath>
										<mainClass>${project.custom.izpack.mainclass}</mainClass>
										<addDependencies>false</addDependencies>
										<preCp>${project.custom.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>
                                        <requireFilesExist>
                                            <files>
                                                <file>target/${project.custom.izpack.jarfilename}.jar</file>
                                            </files>
                                            <message>File target/${project.custom.izpack.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>${project.custom.app.type}</headerType>
                                    <outfile>target/${project.custom.app.jarfilename}.exe</outfile>
                                    <jar>target/${project.custom.app.jarfilename}.jar</jar>
                                    <errTitle>${project.custom.app.jarfilename}</errTitle>
                                    <classPath>
                                        <mainClass>${project.custom.app.mainclass}</mainClass>
                                        <addDependencies>false</addDependencies>
                                        <preCp>${project.custom.app.preclasspath}</preCp>
                                    </classPath>
                                    <icon>${project.custom.launch4j.app.icon}</icon>
                                    <jre>
                                        <minVersion>${project.custom.jre.minversion}</minVersion>
                                    </jre>
                                    <versionInfo>
                                        <fileVersion>${project.custom.launch4j.app.fileversion}</fileVersion>
                                        <txtFileVersion>${project.custom.launch4j.app.txtfileversion}</txtFileVersion>
                                        <fileDescription>${project.custom.launch4j.app.filedescription}</fileDescription>
                                        <copyright>${project.custom.launch4j.app.copyright}</copyright>
                                        <productVersion>${project.custom.launch4j.app.productversion}</productVersion>
                                        <txtProductVersion>${project.custom.launch4j.app.txtproductversion}</txtProductVersion>
                                        <productName>${project.custom.launch4j.app.productname}</productName>
                                        <internalName>${project.custom.launch4j.app.internalname}</internalName>
                                        <originalFilename>${project.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>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.type</property>
                                            <regex>gui|console</regex>
                                            <regexMessage>Property project.custom.app.type must be set. Property must be either "gui" or "cli".</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.app.filedescription</property>
                                            <regex>.+</regex>
                                            <regexMessage>Property project.custom.launch4j.app.filedescription must be set. The property cannot be empty.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.app.originalfilename</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property project.custom.launch4j.app.originalfilename must be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>project.custom.launch4j.app.internalname</property>
                                            <regex>.{1,50}$</regex>
                                            <regexMessage>Property project.custom.launch4j.app.internalname must be set. It cannot exceed 50 characters.</regexMessage>
                                        </requireProperty>
                                        <requireFilesExist>
                                            <files>
                                                <file>target/${project.custom.app.jarfilename}.jar</file>
                                            </files>
                                            <message>File target/${project.custom.app.jarfilename}.jar must exists. Run profile compile-izpack first.</message>
                                        </requireFilesExist>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

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


</project>
