<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>net.sourceforge.javadpkg</groupId>
		<artifactId>dpkg-pom</artifactId>
		<version>1.0.5</version>
	</parent>
	
	<artifactId>dpkg-maven-plugin</artifactId>
	<name>Debian Package Maven Plugin</name>
	<description>The plugin for creating Debian Packages during a Maven build process.</description>
	<packaging>maven-plugin</packaging>
	
	<properties>
		<!-- The version of the Maven Plugin Plugin -->
		<maven-plugin-plugin-version>3.4</maven-plugin-plugin-version>
		
		<!-- The folder for the dependency libraries -->
		<project-lib-dep-folder>${multimodebasedir}/target/lib-dpkg-maven-plugin-dep</project-lib-dep-folder>
		
		<!-- The target directory of the POM -->
		<multimodebasedir>${basedir}/../</multimodebasedir>
		
		<!-- The base directory -->
		<rootPath>../</rootPath>
	</properties>
	
	<dependencies>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.javadpkg</groupId>
			<artifactId>dpkg</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.javadpkg</groupId>
			<artifactId>dpkg</artifactId>
			<version>${project.version}</version>
			<classifier>tests</classifier>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-plugin-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-annotations</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven.plugin-testing</groupId>
			<artifactId>maven-plugin-testing-harness</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-artifact</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-compat</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
	</dependencies>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-plugin-plugin</artifactId>
					<version>${maven-plugin-plugin-version}</version>
					<configuration>
						<goalPrefix>dpkg</goalPrefix>
					</configuration>
					<executions>
						<execution>
							<id>default-descriptor</id>
							<phase>process-classes</phase>
							<goals>
								<goal>descriptor</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>${maven-antrun-plugin-version}</version>
					<executions>
						<execution>
							<id>antrun-post-site</id>
							<phase>site</phase>
							<goals>
								<goal>run</goal>
							</goals>
							<configuration>
								<target>
									<echo message="antrun-post-site - wrap site in a JAR archive..."/>
									<jar destfile="${project-lib-add-folder}/dpkg-pom-${project.parent.version}-site.jar"
										whenempty="fail" level="9">
										
										<fileset dir="${multimodebasedir}/target/site"/>
										<mappedresources>
											<fileset dir="${multimodebasedir}/dpkg/target/site"/>
											<globmapper from="*" to="dpkg/*"/>
										</mappedresources>
										<mappedresources>
											<fileset dir="${project.build.directory}/site"/>
											<globmapper from="*" to="dpkg-maven-plugin/*"/>
										</mappedresources>
									</jar>
									
									<echo message="antrun-post-site - wrap binaries in a ZIP archive..."/>
									<zip destfile="${multimodebasedir}/target/dpkg-${project.parent.version}-bin.zip"
										whenempty="fail" level="9">
										
										<zipfileset dir="${multimodebasedir}/target/lib" prefix="lib"/>
										<zipfileset dir="${multimodebasedir}/target/lib-add" prefix="lib-add"/>
										<zipfileset dir="${multimodebasedir}" includes="pom.xml" prefix="lib-add"/>
										<zipfileset dir="${multimodebasedir}/target/lib-dpkg-dep" prefix="lib-dpkg-dep"/>
										<zipfileset dir="${multimodebasedir}/target/lib-dpkg-maven-plugin-dep"
											prefix="lib-dpkg-maven-plugin-dep"/>
										<zipfileset dir="${multimodebasedir}" includes="lgpl-2.1.txt"/>
									</zip>
									
									<echo message="antrun-post-site - wrap sources in a ZIP archive..."/>
									<zip destfile="${multimodebasedir}/target/dpkg-${project.parent.version}-src.zip"
										whenempty="fail" level="9">
										
										<zipfileset dir="${multimodebasedir}" includes="codetemplates.xml"/>
										<zipfileset dir="${multimodebasedir}" includes="lgpl-2.1.txt"/>
										<zipfileset dir="${multimodebasedir}" includes="pom.xml"/>
										<zipfileset dir="${multimodebasedir}/src" prefix="src"/>
										
										<zipfileset dir="${multimodebasedir}/dpkg" includes="lgpl-2.1.txt" prefix="dpkg"/>
										<zipfileset dir="${multimodebasedir}/dpkg" includes="pom.xml" prefix="dpkg"/>
										<zipfileset dir="${multimodebasedir}/dpkg/src" prefix="dpkg/src"/>
										
										<zipfileset dir="${multimodebasedir}/dpkg-maven-plugin" includes="lgpl-2.1.txt"
											prefix="dpkg-maven-plugin"/>
										<zipfileset dir="${multimodebasedir}/dpkg-maven-plugin" includes="pom.xml"
											prefix="dpkg-maven-plugin"/>
										<zipfileset dir="${multimodebasedir}/dpkg-maven-plugin/src"
											prefix="dpkg-maven-plugin/src"/>
									</zip>
								</target>
							</configuration>
						</execution>
						<execution>
							<id>antrun-site-deploy</id>
							<phase>deploy</phase>
							<goals>
								<goal>run</goal>
							</goals>
							<configuration>
								<echo message="antrun-site-deploy - Upload the ZIP archive..."/>
								<sshexec host="shell.sourceforget.net" username="${username}" password="${password}"
									command="mkdir --parents --verbose /home/frs/project/javadpkg/dpkg-{${project.parent.version}}"/>
								<scp file="${multimodebasedir}/target/dpkg-${project.parent.version}-src.zip"
									todir="${username}:${password}@shell.sourceforget.net:/home/frs/project/javadpkg/dpkg-{${project.parent.version}}/"
									trust="true" failonerror="true" verbose="true"/>
								<scp file="${multimodebasedir}/target/dpkg-${project.parent.version}-bin.zip"
									todir="${username}:${password}@shell.sourceforget.net:/home/frs/project/javadpkg/dpkg-{${project.parent.version}}/"
									trust="true" failonerror="true" verbose="true"/>
							</configuration>
						</execution>
					</executions>
					<configuration>
						<failOnError>true</failOnError>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
	
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
				<version>${maven-plugin-plugin-version}</version>
				<configuration>
					<requirements>
						<maven>3.0.9</maven>
						<jdk>${java-version}</jdk>
					</requirements>
				</configuration>
			</plugin>
		</plugins>
	</reporting>
</project>
