<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.imagingbook</groupId>
	<artifactId>imagingbook-parent-pom</artifactId>
	<version>4.0.0</version>
	<packaging>pom</packaging>

	<name>${project.groupId}:${project.artifactId}</name>

	<description>Java code for image processing books by W. Burger and M.J. Burge</description>
	<inceptionYear>2006</inceptionYear>
	<url>http://www.imagingbook.com</url>

	<developers>
		<developer>
			<name>Wilhelm Burger</name>
		</developer>
		<developer>
			<name>Mark J. Burge</name>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>BSD 2-Clause "Simplified" License</name>
			<url>http://opensource.org/licenses/BSD-2-Clause</url>
		</license>
	</licenses>
	
	<scm>
		<connection>scm:git:git://github.com/imagingbook/imagingbook-public.git</connection>
		<developerConnection>scm:git:ssh://github.com:imagingbook/imagingbook-public.git.git</developerConnection>
		<url>http://github.com/imagingbook/imagingbook-public.git/tree/master</url>
	</scm>

	<properties>	
		<directory-up-1>${project.basedir}${file.separator}..</directory-up-1>
		<directory-up-2>${project.basedir}${file.separator}..${file.separator}..</directory-up-2>
		<directory-up-3>${project.basedir}${file.separator}..${file.separator}..${file.separator}..</directory-up-3>	
		<imagingbook.rootdir>${directory-up-1}</imagingbook.rootdir>   <!-- to be modified by nested projects -->
		
		<!-- <imagingbook.repodir>imagingbook-maven-repository</imagingbook.repodir> -->
		<imagingbook.repodir>DEPLOY</imagingbook.repodir>
		<imagingbook.docdir>${project.basedir}/docs</imagingbook.docdir>
		<imagingbook.buildprofile>DefaultProfile</imagingbook.buildprofile>

		<java.version>1.8</java.version>
		<imagej.version>1.53p</imagej.version> <!-- see https://mvnrepository.com/artifact/net.imagej/ij -->
		<commons-math3.version>3.6.1</commons-math3.version>
		<jtransforms.version>3.1</jtransforms.version>
		<openpdf.version>1.3.25</openpdf.version>
		<junit.version>4.13.1</junit.version>
		
		<maven.compiler.target>${java.version}</maven.compiler.target>
	    <maven.compiler.source>${java.version}</maven.compiler.source>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		
		<imagingbook.skipdeploy>false</imagingbook.skipdeploy>
		<maven.javadoc.skip>false</maven.javadoc.skip>
		<gpg.skip>true</gpg.skip>
	</properties>

	<distributionManagement>
	 	<!-- used by 'mvn deploy' -->
		<repository>
			<!-- <id>local-deploy-repo</id><url>file:///${imagingbook.rootdir}${file.separator}${imagingbook.repodir}</url> -->
			<id>ossrh</id><url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>

		<!--
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>

		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
		-->

	</distributionManagement>

	<dependencyManagement>
		<dependencies>
		
			<!-- https://mvnrepository.com/artifact/net.imagej/ij -->
			<dependency>
				<groupId>net.imagej</groupId>
				<artifactId>ij</artifactId>
				<version>${imagej.version}</version>
			</dependency>

			<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-math3</artifactId>
				<version>${commons-math3.version}</version>
			</dependency>

			<!-- https://mvnrepository.com/artifact/com.github.wendykierp/JTransforms, 
				https://github.com/wendykierp/JTransforms -->
			<dependency>
				<groupId>com.github.wendykierp</groupId>
				<artifactId>JTransforms</artifactId>
				<version>${jtransforms.version}</version>
				<!-- <classifier>with-dependencies</classifier> -->
			</dependency>

			<!-- https://mvnrepository.com/artifact/com.github.librepdf/openpdf -->
			<dependency>
				<groupId>com.github.librepdf</groupId>
				<artifactId>openpdf</artifactId>
				<version>${openpdf.version}</version>
			</dependency>

			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>${junit.version}</version>
				<scope>test</scope>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<dependencies />

	<build>
		<pluginManagement>
			<plugins>
			
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.0.2</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>
				
				<plugin>
					  <groupId>org.apache.maven.plugins</groupId>
					  <artifactId>maven-deploy-plugin</artifactId>
					  <!-- <version>${maven-deploy-plugin-version}</version> -->
					  <configuration>
					    <skip>${imagingbook.skipdeploy}</skip>
					  </configuration>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>3.0.0-M5</version>
					<configuration>
						<goals>deploy</goals>
						<autoversionsubmodules>true</autoversionsubmodules>
					</configuration>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.2.2</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.2.1</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.3.2</version>
				</plugin>
				
				<plugin>  
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-project-info-reports-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>

				<!-- Ignore/Execute plugin execution (https://stackoverflow.com/a/8752807) -->
				<!-- https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<!-- copy-dependency plugin -->
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-dependency-plugin</artifactId>
										<versionRange>[1.0.0,)</versionRange>
										<goals>
											<goal>copy-dependencies</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>

								<!-- <pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.commonjava.maven.plugins</groupId>
										<artifactId>directory-maven-plugin</artifactId>
										<versionRange>[0.1,)</versionRange>
										<goals>
											<goal>directory-of</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution> -->

								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-antrun-plugin</artifactId>
										<versionRange>[1.7,)</versionRange>
										<goals>
											<goal>run</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
				
				<!-- 
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.10.1</version>
					<configuration>
						<source>${java.version}</source>
						<target>${java.version}</target>
						<compilerArgs>
            				<arg>-Xpkginfo:nonempty</arg>
						</compilerArgs>
					</configuration>
				</plugin>
				-->
				
			</plugins>
		</pluginManagement>

		<plugins>
			<!-- skip tests -->
			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> 
				<version>3.0.0-M4</version> <configuration> <skipTests>${skipTests}</skipTests> 
				</configuration> </plugin> -->

			<!-- Directory plugin to find parent root directory absolute path -->
			<!-- <plugin> <groupId>org.commonjava.maven.plugins</groupId> <artifactId>directory-maven-plugin</artifactId> 
				<version>0.1</version> <executions> <execution> <id>directories</id> <goals> 
				<goal>highest-basedir</goal> </goals> <phase>initialize</phase> <configuration> 
				<property>main.basedir</property> </configuration> </execution> </executions> 
				</plugin> -->

			<!-- https://stackoverflow.com/questions/1012402/maven2-property-that-indicates-the-parent-directory/37965143#37965143 -->
			<!-- <plugin> <groupId>org.commonjava.maven.plugins</groupId> <artifactId>directory-maven-plugin</artifactId> 
				<version>0.1</version> <executions> <execution> <id>directories</id> <goals> 
				<goal>directory-of</goal> </goals> <phase>initialize</phase> <configuration> 
				<property>imagingbookFOO.basedir</property> <project> <groupId>com.imagingbook</groupId> 
				<artifactId>imagingbook-parent-pom</artifactId> </project> </configuration> 
				</execution> </executions> </plugin> -->


			<!-- To output the value of certain variables for testing -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>echo</id>
						<phase>initialize</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<!-- output some status information -->
								<echo level="info">**** imagingbook.buildprofile = ${imagingbook.buildprofile}</echo>
								<echo level="info">**** imagingbook.rootdir = ${imagingbook.rootdir}</echo>
								<echo level="info">**** outputDirectory = ${outputDirectory}</echo>
								<echo level="info">**** imagingbook.skipdeploy = ${imagingbook.skipdeploy}</echo>
								<echo level="info">**** maven.javadoc.skip = ${maven.javadoc.skip}</echo>
								<echo level="info">**** gpg.skip = ${gpg.skip}</echo>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>  <!-- add more properties to MANIFEST file -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<!-- <useDefaultManifestFile>true</useDefaultManifestFile> --> <!-- not available since version 3.0.0 -->
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
						</manifest>
						<manifestEntries>
							<!-- <Build-Date>${buildDate}</Build-Date> -->
							<Build-Time>${maven.build.timestamp}</Build-Time>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<plugin>  <!-- generate a separate jar file with source code -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>	<!-- was "jar" only -->
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<!-- Javadoc generation -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
					<!-- Default configuration for all reports -->
					<!-- Problem with Java 12: mixing named and unnamed modules?? -->
					<!-- <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> -->  <!-- add for Java 10, 11, 12 .. -->
					<!-- <source>8</source> -->
					<detectJavaApiLink>false</detectJavaApiLink>
					<reportOutputDirectory>${imagingbook.docdir}</reportOutputDirectory>
					<destDir>javadoc</destDir>
					<!-- <doctitle>${javadoc-doctitle}</doctitle> -->
					<packagesheader>${project.name}</packagesheader>
					<!-- <header>The ImagingBook HEADER</header> -->
					<!-- <footer>The ImagingBook FOOTER</footer> -->
					<!-- <top>The ImagingBook TOP text</top> -->
					<bottom>
	        		<![CDATA[Copyright &#169; {inceptionYear}&#x2013;{currentYear}, 
	        		<a href="http://www.imagingbook.com" target="new">
	        		Wilhelm Burger, Mark J. Burge</a>
	        		<a href="http://opensource.org/licenses/BSD-2-Clause" target="new">
	        		(BSD 2-Clause Simplified License)</a>]]>
					</bottom>
					<show>protected</show>
					<nohelp>true</nohelp>
					<linksource>true</linksource>
					<author>false</author>
					<verbose>true</verbose>
					<!-- <quiet>true</quiet> -->
					<!-- <detectLinks>true</detectLinks> -->
					<!-- <detectOfflineLinks>true</detectOfflineLinks> -->
					<excludePackageNames>*.DATA;*.DATA.*</excludePackageNames>
					<additionalOptions>--frames</additionalOptions> <!-- by default, javadoc does not generate HTML with frames any more! -->
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.0.1</version>
				<configuration>
        			<skip>${gpg.skip}</skip>	<!-- exception with Eclipse maven plugin! -->
    			</configuration>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

	<reporting>
		<plugins>
			<plugin>  
				<!-- to stop Maven complaining about missing version number -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<reportSets>
					<reportSet />
				</reportSets>
			</plugin>

			<!-- NEEDED? aggregate JavaDoc (see https://maven.apache.org/plugins/maven-javadoc-plugin/examples/aggregate.html) -->
			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> 
				<version>3.3.0</version> <reportSets> <reportSet> <id>aggregate</id> <inherited>false</inherited> 
				<reports> <report>aggregate</report> </reports> </reportSet> <reportSet> 
				<id>default</id> <reports> <report>javadoc</report> </reports> </reportSet> 
				</reportSets> </plugin> -->
		</plugins>
	</reporting>



</project>