<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>info.kuechler.bmf</groupId>
	<artifactId>modules</artifactId>
	<version>2022.2.0</version>
	<packaging>pom</packaging>
	<name>parent</name>

	<!-- 
		settings.xml for maven central, sign and github site deployment:
		
		<settings>
			<servers>
				<server>
					<id>ossrh</id>
					<username>username</username>
					<password>password</password>
				</server>
				<server>
					<id>github</id>
					<username>username</username>
					<password>password</password> 
				</server> 
			</servers>
			<profiles>
				<profile>
					<id>ossrh</id>
					<activation>
						<activeByDefault>true</activeByDefault>
					</activation>
					<properties>
						<gpg.executable>/usr/local/bin/gpg</gpg.executable>
						<gpg.passphrase>passphrase</gpg.passphrase>
					</properties>
				</profile>
			</profiles>
		</settings>

		release into maven central:
		mvn clean deploy -P release, <autoReleaseAfterClose> have to set to "false"
		mvn nexus-staging:release -P release
		
		Deploy site to github:
		mvn clean site -P deploy-site
	 -->
	<url>https://github.com/taxcalcs/modules</url>
	<description>Parent-POM</description>

	<inceptionYear>2020</inceptionYear>
	<issueManagement>
		<system>github</system>
		<url>https://github.com/taxcalcs/modules/issues</url>
	</issueManagement>
	<licenses>
		<license>
			<name>The MIT License (MIT)</name>
			<url>https://opensource.org/licenses/mit-license.php</url>
		</license>
	</licenses>
	<developers>
		<developer>
			<name>Ariel Küchler</name>
			<url>https://github.com/admiralsmaster</url>
		</developer>
	</developers>
	<scm>
		<connection>scm:git:git://github.com/taxcalcs/modules.git</connection>
		<developerConnection>scm:git:ssh://github.com:taxcalcs/modules.git</developerConnection>
		<url>http://github.com/taxcalcs/modules/tree/master</url>
	</scm>

	<properties>
		<project.java.version>1.8</project.java.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		
		<org.junit.jupiter.version>5.8.2</org.junit.jupiter.version>
		<org.junit.platform.version>1.8.2</org.junit.platform.version>
		<javax.xml.bind.version>2.4.0-b180830.0359</javax.xml.bind.version>
		<org.glassfish.jaxb.version>2.4.0-b180830.0438</org.glassfish.jaxb.version>
		<javax.annotation.version>1.3.2</javax.annotation.version>
		<com.github.jaxb-xew-plugin.version>1.11</com.github.jaxb-xew-plugin.version>
		<org.slf4j.version>1.7.32</org.slf4j.version>
		<org.apache.logging.log4j.version>2.17.2</org.apache.logging.log4j.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpclient</artifactId>
				<version>4.5.13</version>
				<exclusions>
					<exclusion>
						<!-- exclude, we use slf4j with adapter for commons logging -->
						<artifactId>commons-logging</artifactId>
						<groupId>commons-logging</groupId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
			    <groupId>org.apache.commons</groupId>
			    <artifactId>commons-lang3</artifactId>
			    <version>3.12.0</version>
			</dependency>
			<dependency>
			    <groupId>org.apache.commons</groupId>
			    <artifactId>commons-csv</artifactId>
			    <version>1.9.0</version>
			</dependency>
	
			<!-- logging for tests -->
			<dependency>
				<!-- we use slf4j -->
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${org.slf4j.version}</version>
			</dependency>
			<dependency>
				<!-- commons-logging bridge for httpclient -->
				<groupId>org.slf4j</groupId>
				<artifactId>jcl-over-slf4j</artifactId>
				<version>${org.slf4j.version}</version>
			</dependency>
			<dependency>
				<!-- log4j-2 adapter -->
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-slf4j-impl</artifactId>
				<version>${org.apache.logging.log4j.version}</version>
			</dependency>
			<dependency>
				<!-- log4j-2 impl -->
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-core</artifactId>
				<version>${org.apache.logging.log4j.version}</version>
			</dependency>
			
			<!-- test dependencies -->
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-api</artifactId>
				<version>${org.junit.jupiter.version}</version>
			</dependency>
			<dependency>
			    <groupId>org.junit.jupiter</groupId>
			    <artifactId>junit-jupiter-params</artifactId>
			    <version>${org.junit.jupiter.version}</version>
			</dependency>
			<dependency>
	            <groupId>org.junit.jupiter</groupId>
	            <artifactId>junit-jupiter-engine</artifactId>
	            <version>${org.junit.jupiter.version}</version>
	        </dependency>
	        <dependency>
				<groupId>org.junit.platform</groupId>
				<artifactId>junit-platform-launcher</artifactId>
				<version>${org.junit.platform.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.jvnet.jaxb2.maven2</groupId>
					<artifactId>maven-jaxb2-plugin</artifactId>
					<version>0.14.0</version>
				</plugin>
				
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>
				
				<plugin>
					<groupId>com.google.code.maven-replacer-plugin</groupId>
					<artifactId>replacer</artifactId>
					<version>1.5.3</version>
				</plugin>
				
				<plugin>
					<groupId>net.sf.xsltmp</groupId>
					<artifactId>xslt-generator-maven-plugin</artifactId>
					<version>1.8</version>
				</plugin>
				
				<plugin>
					<groupId>net.revelc.code.formatter</groupId>
					<artifactId>formatter-maven-plugin</artifactId>
					<!-- JDK 1.8 -->
					<version>2.16.0</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-project-info-reports-plugin</artifactId>
					<version>3.1.2</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>
				
				<plugin>
					<groupId>com.github.github</groupId>
					<artifactId>site-maven-plugin</artifactId>
					<version>0.12</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.0.0</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-compiler-plugin</artifactId>
					<version>3.8.1</version>
				</plugin>
				
				<plugin>
    				<groupId>org.apache.maven.plugins</groupId>
	    			<artifactId>maven-site-plugin</artifactId>
	    			<version>3.12.1</version>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.2.0</version>
	            </plugin>
	            
	            <plugin>
				    <groupId>org.apache.maven.plugins</groupId>
				    <artifactId>maven-surefire-plugin</artifactId>
				    <version>2.22.2</version>
			    </plugin>
			    
			    <plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>
				
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.13</version>
				</plugin>
			</plugins>
		</pluginManagement>
		
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>${project.java.version}</source>
					<target>${project.java.version}</target>
				</configuration>
			</plugin>

			<plugin>
    			<groupId>org.apache.maven.plugins</groupId>
    			<artifactId>maven-site-plugin</artifactId>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
            </plugin>
            
            <!-- surefire latest version for parameterized junit5 tests -->
			<plugin>
			    <groupId>org.apache.maven.plugins</groupId>
			    <artifactId>maven-surefire-plugin</artifactId>
				<executions>
					<execution>
						<id>default-test</id>
						<phase>test</phase>
						<goals>
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>javadoc</report>
							<report>test-javadoc</report>
						</reports>
					</reportSet>
					<reportSet>
						<id>aggregate</id>
						<inherited>false</inherited>
						<reports>
							<report>aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
				<configuration>
					<encoding>${project.build.sourceEncoding}</encoding>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

	<profiles>
		<profile>
			<id>deploy-site</id>
			<build>
				<plugins>
					<!-- site deployment to github -->
					<plugin>
						<groupId>com.github.github</groupId>
						<artifactId>site-maven-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>site</goal>
								</goals>
								<phase>site</phase>
								<configuration>
									<server>github</server>
									<message>Building site</message>
									<repositoryName>taxapi</repositoryName>
									<repositoryOwner>admiralsmaster</repositoryOwner>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<profile>
			<!-- profile for jdk9 and greater -->
			<id>jdk9</id>
			<activation>
				<jdk>(1.8,)</jdk>
			</activation>
			<dependencies>
				<dependency>
				    <groupId>javax.xml.bind</groupId>
				    <artifactId>jaxb-api</artifactId>
				    <version>${javax.xml.bind.version}</version>
				</dependency>
				<dependency>
					<groupId>org.glassfish.jaxb</groupId>
					<artifactId>jaxb-runtime</artifactId>
					<version>${org.glassfish.jaxb.version}</version>
					<scope>test</scope>
				</dependency>
				<dependency>
				    <groupId>javax.annotation</groupId>
				    <artifactId>javax.annotation-api</artifactId>
				    <version>${javax.annotation.version}</version>
				</dependency>
			</dependencies>
		</profile>
		
		<profile>
			<!-- profile for release, local development is faster w/o this plugins -->
			<id>release</id>

			<!-- snapshot repository for release -->
			<distributionManagement>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
			</distributionManagement>

			<build>
				<plugins>

					<!-- right java version, no release with higher java version -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<executions>
							<execution>
								<id>display-info</id>
								<phase>validate</phase>
								<goals>
									<goal>display-info</goal>
								</goals>
							</execution>
							<execution>
								<id>enforce-versions</id>
								<phase>validate</phase>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireJavaVersion>
											<version>[1.8,1.9)</version>
										</requireJavaVersion>
									</rules>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- create source jar -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<!-- create javadoc jar -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<!-- sign files -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<!-- plugin for release -->
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>false</autoReleaseAfterClose>
						</configuration>
					</plugin>

				</plugins>
			</build>
		</profile>
	</profiles>
</project>
