<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>io.github.dbstarll.parent</groupId>
    <artifactId>parent</artifactId>
    <version>1.2.9</version>
  </parent>
  <artifactId>pure</artifactId>
  <packaging>pom</packaging>

  <name>pure</name>
  <description>parent for pure java</description>
  <url>https://github.com/dbstarll/parent/tree/main/pure</url>

  <properties>
    <!-- Global Config -->
    <project.java.version>1.8</project.java.version>

    <!-- JDK -->
    <maven.compiler.compilerVersion>${project.java.version}</maven.compiler.compilerVersion>
    <maven.compiler.source>${project.java.version}</maven.compiler.source>
    <maven.compiler.target>${project.java.version}</maven.compiler.target>

    <!-- Plugin Version -->
    <version.maven-compiler-plugin>3.10.1</version.maven-compiler-plugin>
    <version.maven-jar-plugin>3.3.0</version.maven-jar-plugin>
    <version.maven-javadoc-plugin>3.4.1</version.maven-javadoc-plugin>
    <version.maven-resources-plugin>3.3.0</version.maven-resources-plugin>
    <version.maven-source-plugin>3.2.1</version.maven-source-plugin>

    <!-- Reporting Plugin Version -->
    <version.maven-jxr-plugin>3.3.0</version.maven-jxr-plugin>
    <version.maven-checkstyle-plugin>3.2.0</version.maven-checkstyle-plugin>
    <version.checkstyle>9.3</version.checkstyle>
    <version.maven-changelog-plugin>2.3</version.maven-changelog-plugin>
    <version.maven-pmd-plugin>3.19.0</version.maven-pmd-plugin>
    <version.jdepend-maven-plugin>2.0</version.jdepend-maven-plugin>
    <version.findbugs-maven-plugin>3.0.5</version.findbugs-maven-plugin>
    <version.taglist-maven-plugin>3.0.0</version.taglist-maven-plugin>

    <!-- Test Plugin Version-->
    <version.junit-jupiter>5.9.2</version.junit-jupiter>
    <version.maven-surefire-plugin>3.0.0-M7</version.maven-surefire-plugin>
    <version.maven-surefire-report-plugin>3.0.0-M8</version.maven-surefire-report-plugin>
    <version.jacoco-maven-plugin>0.8.8</version.jacoco-maven-plugin>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${version.maven-compiler-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${version.maven-jar-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.maven-javadoc-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${version.maven-resources-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${version.maven-source-plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>java-main</id>
      <activation>
        <file>
          <exists>src/main/java</exists>
        </file>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <executions>
                <execution>
                  <goals>
                    <goal>jar</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-source-plugin</artifactId>
              <executions>
                <execution>
                  <goals>
                    <goal>jar-no-fork</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jxr-plugin</artifactId>
              <version>${version.maven-jxr-plugin}</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-checkstyle-plugin</artifactId>
              <version>${version.maven-checkstyle-plugin}</version>
              <configuration>
                <configLocation>https://dbstarll.github.io/sun_checks-120.xml</configLocation>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>com.puppycrawl.tools</groupId>
                  <artifactId>checkstyle</artifactId>
                  <version>${version.checkstyle}</version>
                </dependency>
              </dependencies>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-changelog-plugin</artifactId>
              <version>${version.maven-changelog-plugin}</version>
              <configuration>
                <!-- <displayFileDetailUrl>${project.git.web.master}/%FILE%</displayFileDetailUrl> -->
                <displayFileRevDetailUrl>${project.git.web.root}/blob/%REV%/%FILE%</displayFileRevDetailUrl>
                <displayChangeSetDetailUrl>${project.git.web.root}/commit/%REV%</displayChangeSetDetailUrl>
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-pmd-plugin</artifactId>
              <version>${version.maven-pmd-plugin}</version>
            </plugin>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>jdepend-maven-plugin</artifactId>
              <version>${version.jdepend-maven-plugin}</version>
            </plugin>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>findbugs-maven-plugin</artifactId>
              <version>${version.findbugs-maven-plugin}</version>
              <configuration>
                <threshold>Low</threshold>
                <effort>Max</effort>
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>taglist-maven-plugin</artifactId>
              <version>${version.taglist-maven-plugin}</version>
              <configuration>
                <tagListOptions>
                  <tagClasses>
                    <tagClass>
                      <displayName>Todo Work Annotation</displayName>
                      <tags>
                        <tag>
                          <matchString>TODO</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                        <tag>
                          <matchString>@todo</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                        <tag>
                          <matchString>FIXME</matchString>
                          <matchType>exact</matchType>
                        </tag>
                      </tags>
                    </tagClass>
                    <tagClass>
                      <displayName>Version Annotation</displayName>
                      <tags>
                        <tag>
                          <matchString>@deprecated</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                      </tags>
                    </tagClass>
                  </tagClasses>
                </tagListOptions>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jxr-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-changelog-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jdepend-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>taglist-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </reporting>
    </profile>

    <profile>
      <id>java-test</id>
      <activation>
        <file>
          <exists>src/test/java</exists>
        </file>
      </activation>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${version.junit-jupiter}</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter-engine</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>${version.maven-surefire-plugin}</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jar-plugin</artifactId>
              <executions>
                <execution>
                  <goals>
                    <goal>test-jar</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <executions>
                <execution>
                  <goals>
                    <goal>test-jar</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <show>package</show>
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-source-plugin</artifactId>
              <executions>
                <execution>
                  <goals>
                    <goal>test-jar-no-fork</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-report-plugin</artifactId>
              <version>${version.maven-surefire-report-plugin}</version>
            </plugin>
            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>${version.jacoco-maven-plugin}</version>
              <executions>
                <execution>
                  <id>prepare-agent</id>
                  <goals>
                    <goal>prepare-agent</goal>
                  </goals>
                </execution>
                <execution>
                  <id>report</id>
                  <goals>
                    <goal>report</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <reportSets>
              <reportSet>
                <reports>
                  <report>report</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>

    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
