<?xml version="1.0" encoding="UTF-8"?>
<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>

	<groupId>de.unkrig.zz</groupId>
	<artifactId>zz-parent</artifactId>
	<version>1.3.10</version>

	<packaging>pom</packaging>

	<name>zz-parent</name>
	<url>http://zz.unkrig.de/</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<build>
		<pluginManagement>
			<plugins>

				<!--
					Creates an all-inclusive JAR file. That .jar file can be used...
					* ... as an ANTLIB:
						<taskdef resource="de/unkrig/zz/zz-diff.xml" classpath="path/to/zz-diff-x.y.z-jar-with-dependencies.jar" />
					* ... to run the command line tool with a single .jar file on the classpath:
						java -cp path/to/zz-diff-x.y.z-jar-with-dependencies.jar de.unkrig.zz.diff.Main
				-->
				<!--
					Because we want to merge the "formats" files, we must use a custom "descriptor" instead of descriptor-ref
					"jar-with-dependencies". The "file-aggregator" works like sh...:
					* It must be executed *twice* because otherwise the output file is empty
					* It can handle only one pattern+outputfile (we need two for compressors and archives)
				-->
				<plugin>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>2.6</version>
					<configuration>
						<descriptor>../zz-parent/mydesc.xml</descriptor>
						<archive>
							<manifest>
								<mainClass>${jar-with-dependencies.mainClass}</mainClass>
							</manifest>
						</archive>
					</configuration>
					<executions>
						<execution>
							<id>make-jar-with-dependencies</id>
							<phase>package</phase>
							<goals><goal>single</goal></goals>
						</execution>
						<!-- Execute it twice; otherwise it won't work. -->
						<execution>
							<id>make-jar-with-dependencies2</id>
							<phase>package</phase>
							<goals><goal>single</goal></goals>
						</execution>
					</executions>
				</plugin>

				<!-- Creates an MS WINDOWS executable. -->
				<plugin>
					<groupId>com.akathist.maven.plugins.launch4j</groupId>
					<artifactId>launch4j-maven-plugin</artifactId>
					<version>1.7.12</version>
					<executions>
						<execution>
							<id>attach-windows-exe</id>

							<goals><goal>launch4j</goal></goals>

							<configuration>
								<headerType>console</headerType>
								<outfile>target/${project.name}-${project.version}.exe</outfile>
								<jar>target/${project.name}-${project.version}-jar-with-dependencies.jar</jar>
								<errTitle>${project.name}</errTitle>
								<classPath>
									<addDependencies>false</addDependencies>
									<mainClass>${jar-with-dependencies.mainClass}</mainClass>
								</classPath>
								<jre><minVersion>1.8.0</minVersion></jre>
								<versionInfo>
									<fileVersion>0.0.0.0</fileVersion>
									<txtFileVersion>${project.version}</txtFileVersion>
									<fileDescription>${project.name}</fileDescription>
									<copyright>Copyright Arno Unkrig 2016-2022. All rights reserved.</copyright>
									<productVersion>0.0.0.0</productVersion>
									<txtProductVersion>${project.version}</txtProductVersion>
									<productName>${project.name}</productName>
									<internalName>${project.name}</internalName>
									<originalFilename>${project.name}-${project.version}.exe</originalFilename>
									<languageIndex>0x0409</languageIndex>
								</versionInfo>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<!-- Attaches the MS WINDOWS executable artifact (so that it is INSTALLed and DEPLOYed). -->
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>1.12</version>
					<executions>
						<execution>
							<id>attach-artifacts</id>
							<phase>package</phase>
							<goals><goal>attach-artifact</goal></goals>
							<configuration>
								<artifacts>
									<artifact>
										<file>target/${project.name}-${project.version}.exe</file>
										<type>exe</type>
									</artifact>
								</artifacts>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<!-- Creates and attaches a JAR file containing the sources. -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.4</version>
					<executions>
						<execution>
							<id>attach-sources</id>
							<goals><goal>jar</goal></goals>
						</execution>
					</executions>
				</plugin>

				<!-- Stages (uploads) the artifact to oss.sonatype.org. -->
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.8</version>
					<extensions>true</extensions>
					<configuration>
						 <serverId>ossrh</serverId>
						 <nexusUrl>https://oss.sonatype.org/</nexusUrl>
						 <autoReleaseAfterClose>false</autoReleaseAfterClose>
					</configuration>
				</plugin>

				<!-- Signs the artifacts with GPG (oss.sonatype.org requires that). -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.5</version>
					<executions>
						<execution>
							<id>sign-artifacts</id>
							<phase>verify</phase>
							<goals><goal>sign</goal></goals>
						</execution>
					</executions>
				</plugin>

				<!--
					Creates a JAR file containing the API documentation (javadoc) and an HTML help document for the
					command line tool (MAINDOC).
				-->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.10.4</version>
					<executions>

						<!-- Generate the API docs. -->
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>

							<configuration>
								<header>${project.name} ${project.version}</header>
								<footer>${project.name} ${project.version}</footer>
								<javadocVersion>1.8</javadocVersion>
								<additionalparam>-Xdoclint:none</additionalparam>
								<quiet>true</quiet>
								<tags>
									<tag><name>ant.defaultValue</name>    <placement>a</placement><head>Default value:</head>              </tag>
									<tag><name>ant.mandatory</name>       <placement>a</placement><head>This attribute is mandatory.</head></tag>
									<tag><name>ant.subelementOrder</name> <placement>X</placement>                                         </tag>
									<tag><name>ant.typeGroupHeading</name><placement>X</placement>                                         </tag>
									<tag><name>ant.typeGroupName</name>   <placement>a</placement><head>Type group:</head>                 </tag>
									<tag><name>ant.typeGroupSubdir</name> <placement>X</placement>                                         </tag>
									<tag><name>ant.typeHeadingMf</name>   <placement>X</placement>                                         </tag>
									<tag><name>ant.typeTitleMf</name>     <placement>X</placement>                                         </tag>
									<tag><name>ant.valueExplanation</name><placement>a</placement><head>Value:</head>                      </tag>

									<tag><name>main.commandLineOptions</name><placement>X</placement></tag>
									<tag><name>main.commandLineOptionGroup</name><placement>a</placement><head>Option group:</head></tag>
								</tags>
							</configuration>
						</execution>

						<!-- Generate the command-line help doc. -->
						<execution>

							<id>make-maindoc</id>
							<phase>compile</phase>
							<goals><goal>javadoc</goal></goals>

							<configuration>
								<useStandardDocletOptions>false</useStandardDocletOptions>
								<additionalparam>-Xdoclint:none</additionalparam>

								<quiet>true</quiet>

								<doclet>de.unkrig.doclet.main.MainDoclet</doclet>
								<docletArtifact>
									<groupId>de.unkrig</groupId>
									<artifactId>doclet-main</artifactId>
									<version>1.0.4</version>
								</docletArtifact>

								<additionalparam>
									-charset     UTF-8
									-docencoding UTF-8
								</additionalparam>

								<destDir>../../classes</destDir>
							</configuration>
						</execution>

						<!-- NOTICE: ANTDOC is generated by "zz-all", not here. -->
					</executions>
				</plugin>

				<!--
					Converts the an HTML help document into TXT format and stores it in "target/classes", so that
					"-help" can print it.
				-->
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.5.0</version>

					<dependencies>
						<dependency>
							<groupId>de.unkrig</groupId>
							<artifactId>html2txt</artifactId>
							<version>1.0.3</version>
						</dependency>
					</dependencies>

					<executions><execution>
						<id>html2txt-maindoc</id>
						<phase>compile</phase>
						<goals><goal>java</goal></goals>
						<configuration>
							<includePluginDependencies>true</includePluginDependencies>
							<mainClass>de.unkrig.html2txt.Main</mainClass>
							<arguments>
								<argument>${basedir}/target/classes/${jar-with-dependencies.mainClass2}.main(String[]).html</argument>
								<argument>${basedir}/target/classes/${jar-with-dependencies.mainClass2}.main(String[]).txt</argument>
							</arguments>
						</configuration>
					</execution></executions>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>

			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<profiles>

		<!-- Signs all artifacts with GPG (oss.sonatype.org requires that). -->
		<profile>
			<id>have_gpg</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<description>de.unkrig.zz - A set of command-line tools and ANT tasks that handle not only directories and files, but also archive and compressed files, and even nested archive files.</description>

	<organization>
		<name>Arno Unkrig</name>
		<url>http://unkrig.de/</url>
	</organization>

	<scm>
		<url>https://svn.code.sf.net/p/loggifier/code/de.unkrig.zz</url>
	</scm>

	<licenses>
		<license>
			<name>New BSD License</name>
			<url>http://unkrig.de/w/Html2txt#License</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>aunkrig</id>
			<name>Arno Unkrig</name>
			<roles>
				<role>Developer</role>
				<role>Release Manager</role>
			</roles>
		</developer>
	</developers>
	<modules>
		<module>../zz-diff</module>
		<module>../zz-find</module>
		<module>../zz-grep</module>
		<module>../zz-pack</module>
		<module>../zz-patch</module>
		<module>../zz-all</module>
	</modules>
</project>
