<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</artifactId>
	<packaging>pom</packaging>
    <name>Installation :: IzPack</name>
	<version>2.3-rc4</version>
	<description>IzPack installer support. Defines a new property compile-izpack that will bundle and create an IzPack installer Jar file.</description>
    <inceptionYear>2011</inceptionYear>
	<url>https://anrisoftware.com/projects/projects/globalpom-groovy-izpack</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.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>run.bat</project.custom.app.windowsbin>
        <project.custom.app.windowsdebugbin>debug-run.bat</project.custom.app.windowsdebugbin>
        <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.jre.minversion>${project.custom.source.source}.0</project.custom.jre.minversion>
	</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>

    <organization>
        <name>Advanced Natural Research Institute</name>
        <url>https://anrisoftware.com</url>
    </organization>

    <issueManagement>
        <system>Redmine</system>
        <url>https://anrisoftware.com/projects/projects/globalpom-groovy-izpack</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-groovy-izpack/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>
			</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>
									<excludeScope>test</excludeScope>
									<includeScope>compile</includeScope>
									<stripVersion>true</stripVersion>
									<!-- don't want standalone 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>
                                    <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>
                                        <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>

	</profiles>

</project>
