<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2019 Mike Hummel (mh@mhus.de)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
    <parent>
		<groupId>de.mhus.lib</groupId>
		<version>7.7.0</version>
	    <artifactId>mhus-parent</artifactId>
    </parent>
	<artifactId>mhus-oss</artifactId>
	<packaging>pom</packaging>
	<description>Parent POM for all mhus open source java projects</description>
	<url>https://www.mhus.info</url>
    <inceptionYear>2020</inceptionYear>
    
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<scm>
		<url>https://github.com/mhus/mhus-parent</url>
		<connection>scm:git:https://github.com/mhus/mhus-parent/</connection>
		<tag>HEAD</tag>
	</scm>
	<build>
        <pluginManagement>
	        <plugins>
	            <plugin>
	                <groupId>de.mhus.mvn.plugin</groupId>
	                <version>${manual.collector.plugin}</version>
	                <artifactId>manual-collector-maven-plugin</artifactId>
	                <configuration>
	                    <outputDirectory>manual/src/main/asciidoc/categories</outputDirectory>
	                    <cleanupOutputDirectory>true</cleanupOutputDirectory>
	                    <generateIndexFiles>true</generateIndexFiles>
	                    <!-- 
	                    <textHeader>"==== {{title}}&#xA;&#xA;.Source&#xA;[%collapsible]&#xA;====&#xA;{{file.path}}&#xA;====&#xA;&#xA;"</textHeader>
	                     -->
                        <textHeader>"==== {{title}}&#xA;&#xA;// {{file.path}}&#xA;&#xA;"</textHeader>
	                </configuration>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>collect</goal>
                            </goals>
                        </execution>
                    </executions>
	            </plugin>
	            <plugin>
	                <groupId>org.asciidoctor</groupId>
	                <artifactId>asciidoctor-maven-plugin</artifactId>
	                <version>2.0.0</version>
	                <executions>
	                    <execution>
	                        <id>output-html</id>
	                        <phase>generate-resources</phase>
	                        <goals>
	                            <goal>process-asciidoc</goal>
	                        </goals>
	                        <configuration>
	                            <sourceHighlighter>coderay</sourceHighlighter>
	                            <backend>html5</backend>
	                            <doctype>article</doctype>
	                            <preserveDirectories>true</preserveDirectories>
	                            <attributes>
	                                <toc />
	                                <linkcss>false</linkcss>
	                            </attributes>
	                        </configuration>
	                    </execution>
	                </executions>
	                <configuration>
	                    <sourceDirectory>src/main/asciidoc</sourceDirectory>
	                    <headerFooter>true</headerFooter>
	                    <imagesDir>src/main/asciidoc/images</imagesDir>
	                </configuration>
	            </plugin>
	            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
	            <plugin>
	            	<groupId>org.eclipse.m2e</groupId>
	            	<artifactId>lifecycle-mapping</artifactId>
	            	<version>1.0.0</version>
	            	<configuration>
	            		<lifecycleMappingMetadata>
	            			<pluginExecutions>
	            				<pluginExecution>
	            					<pluginExecutionFilter>
	            						<groupId>
	            							de.mhus.mvn.plugin
	            						</groupId>
	            						<artifactId>
	            							manual-collector-maven-plugin
	            						</artifactId>
	            						<versionRange>
	            							[1.1.0,)
	            						</versionRange>
	            						<goals>
	            							<goal>collect</goal>
	            						</goals>
	            					</pluginExecutionFilter>
	            					<action>
	            						<ignore></ignore>
	            					</action>
	            				</pluginExecution>
	            			</pluginExecutions>
	            		</lifecycleMappingMetadata>
	            	</configuration>
	            </plugin>
	        </plugins>
        </pluginManagement>
		<plugins>
			<plugin>
				<groupId>de.mhus.mvn.plugin</groupId>
				<artifactId>license-maven-plugin</artifactId>
			</plugin>
		</plugins>

	</build>

    <profiles>
        <profile>
            <id>site-mhus</id>
            <build>
                <plugins>
		            <plugin>
		              <groupId>org.apache.maven.plugins</groupId>
		              <artifactId>maven-site-plugin</artifactId>
		              <version>3.9.1</version>
		              <configuration>
		                    <skip>${maven-site-plugin.skip}</skip>
		                    <siteDirectory>${session.executionRootDirectory}/src/site</siteDirectory>
		              </configuration>
		            </plugin>
		            <plugin>
		                <groupId>org.apache.maven.plugins</groupId>
		                <artifactId>maven-antrun-plugin</artifactId>
		                <version>3.0.0</version>
		                <executions>
		                    <execution>
		                        <id>id.pre-site</id>
		                        <phase>pre-site</phase>
		                        <goals>
		                            <goal>run</goal>
		                        </goals>
		                        <configuration>
		                            <failOnError>false</failOnError>
		                            <target>
		                                <ant antfile="${basedir}/src/site/prepare-site.xml">
		                                  <target name="prepare"/>
		                                </ant>
		                            </target>
		                        </configuration>
		                    </execution>
		                  </executions>
		            </plugin>
                </plugins>
            </build>
            
		  <reporting>
		    <plugins>
		      <plugin>
		        <groupId>org.apache.maven.plugins</groupId>
		        <artifactId>maven-project-info-reports-plugin</artifactId>
		        <version>3.1.0</version>
		      </plugin>
		      <plugin>
		        <groupId>org.apache.maven.plugins</groupId>
		        <artifactId>maven-javadoc-plugin</artifactId>
		        <version>${javadoc.plugin}</version>
		        <configuration>
		            <failOnError>false</failOnError>
		        </configuration>
		        <reportSets>
		          <reportSet><!-- by default, id = "default" -->
		            <reports><!-- select non-aggregate reports -->
		              <report>javadoc</report>
		              <report>test-javadoc</report>
		            </reports>
		          </reportSet>
		          <reportSet><!-- aggregate reportSet, to define in poms having modules -->
		            <id>aggregate</id>
		            <inherited>false</inherited><!-- don't run aggregate in child modules -->
		            <reports>
		              <report>aggregate</report>
		            </reports>
		          </reportSet>
		        </reportSets>
		      </plugin>
		      <plugin>
		        <groupId>org.apache.maven.plugins</groupId>
		        <artifactId>maven-surefire-report-plugin</artifactId>
		        <version>3.0.0-M5</version>
		      </plugin>
		      <plugin>
		        <groupId>org.apache.maven.plugins</groupId>
		        <artifactId>maven-jxr-plugin</artifactId>
		        <version>3.0.0</version>
		        <reportSets>
		          <reportSet>
		            <id>aggregate</id>
		            <inherited>false</inherited>
		            <reports>
		              <report>aggregate</report>
		            </reports>
		          </reportSet>
		        </reportSets>
		      </plugin>
		
		            
		     <plugin>
		        <artifactId>maven-clover-plugin</artifactId>
		        <groupId>org.apache.maven.plugins</groupId>
		        <version>2.4</version>
		      </plugin>
		      
		      <plugin>
		         <groupId>org.apache.maven.plugins</groupId>
		         <artifactId>maven-pmd-plugin</artifactId>
		         <version>3.13.0</version>
		         <configuration>
		            <targetjdk>11</targetjdk>
		            <rulesets>
		               <ruleset>/rulesets/java/maven-pmd-plugin-default.xml</ruleset>
		            </rulesets>
		            <format>xml</format>
		            <linkXref>true</linkXref>
		            <sourceEncoding>utf-8</sourceEncoding>
		            <minimumTokens>100</minimumTokens>
		         </configuration>
		      </plugin>
		      
		      <plugin>
		        <groupId>org.codehaus.mojo</groupId>
		        <artifactId>taglist-maven-plugin</artifactId>
		        <version>2.4</version>
		      </plugin>
		      
		    </plugins>
		    </reporting>
		
		  <distributionManagement>
		    <site>
		      <id>www.mhus.info</id>
		      <url>scp://www.mhus.info/www/docs/project/</url>
		    </site>
		  </distributionManagement>
            
        </profile>
    </profiles>
</project>
