<!--

    Copyright (C) 2008-2023 Mycila (mathieu.carbou@gmail.com)

    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

            https://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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.mycila</groupId>
    <artifactId>mycila-pom</artifactId>
    <version>12</version>
    <relativePath />
  </parent>

  <artifactId>license-maven-plugin-parent</artifactId>
  <version>4.3</version>
  <packaging>pom</packaging>

  <name>license-maven-plugin-parent</name>
  <description>Contains a Maven 2 plugin to check and update license headers in source files and its optional
    dependencies
  </description>
  <inceptionYear>2008</inceptionYear>
  <url>https://mycila.carbou.me/license-maven-plugin/reports/${project.version}</url>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/mathieucarbou/${mycila.github.name}/issues</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub</system>
    <url>https://github.com/mathieucarbou/${mycila.github.name}/actions</url>
  </ciManagement>

  <properties>
    <!-- Get method parameter names via reflection -->
    <maven.compiler.parameters>true</maven.compiler.parameters>

    <!-- Maven compiler options -->
    <java.version>8</java.version>
    <java.release.version>8</java.release.version>
    <java.test.version>${java.version}</java.test.version>
    <java.test.release.version>${java.release.version}</java.test.release.version>

    <!-- Legacy compiler options source/target not really needed now (but still used by things like sonar, m2e) -->
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.testSource>${java.test.version}</maven.compiler.testSource>
    <maven.compiler.testTarget>${java.test.version}</maven.compiler.testTarget>

    <maven.compiler.release>${java.release.version}</maven.compiler.release>
    <maven.compiler.testRelease>${java.test.release.version}</maven.compiler.testRelease>

    <!-- Project Encoding -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <mycila.github.name>license-maven-plugin</mycila.github.name>

    <groovy.version>4.0.15</groovy.version>
    <jacoco.minimum.coverage>1.00</jacoco.minimum.coverage>
    <junit.version>5.10.0</junit.version>
  </properties>

  <modules>
    <module>license-maven-plugin</module>
    <module>license-maven-plugin-git</module>
    <module>license-maven-plugin-svn</module>
    <module>license-maven-plugin-fs</module>
  </modules>

  <developers>
    <developer>
      <id>mathieucarbou</id>
      <name>Mathieu Carbou</name>
      <email>mathieu.carbou@gmail.com</email>
      <url>https://mathieu.photography/</url>
      <organization>mathieucarbou</organization>
      <organizationUrl>https://github.com/mathieucarbou</organizationUrl>
      <roles>
        <role>Architect</role>
        <role>Developer</role>
      </roles>
    </developer>
    <developer>
      <id>jlandis</id>
      <name>Jeremy Landis</name>
      <email>jeremylandis@hotmail.com</email>
      <url>https://www.linkedin.com/in/jeremy-landis-548b2719</url>
      <organization>hazendaz</organization>
      <organizationUrl>https://github.com/hazendaz</organizationUrl>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>-5</timezone>
      <properties>
        <picUrl>https://avatars0.githubusercontent.com/u/975267</picUrl>
      </properties>
    </developer>
  </developers>
  <contributors>
    <contributor>
      <name>Peter Palaga</name>
      <email>ppalaga@redhat.com</email>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
    <contributor>
      <name>masakimu</name>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
    <contributor>
      <name>Matthieu Brouillard</name>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
    <contributor>
      <name>Royce Remer</name>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
    <contributor>
      <name>Juergen Hoeller</name>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
    <contributor>
      <name>Rob Harrop</name>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
    <contributor>
      <name>Cedric Pronzato</name>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
    <contributor>
      <name>Michael J. Simons</name>
      <roles>
        <role>Developer</role>
      </roles>
    </contributor>
  </contributors>

  <scm>
    <connection>scm:git:https://github.com/mycila/${mycila.github.name}.git</connection>
    <developerConnection>scm:git:git@github.com:mycila/${mycila.github.name}.git</developerConnection>
    <url>https://github.com/mathieucarbou/${mycila.github.name}</url>
    <tag>license-maven-plugin-4.3</tag>
  </scm>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>3.9.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>3.9.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>3.9.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>3.9.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.9.0</version>
      </dependency>
      <dependency>
        <groupId>com.mycila</groupId>
        <artifactId>mycila-xmltool</artifactId>
        <version>4.4.ga</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-testing</groupId>
        <artifactId>maven-plugin-testing-harness</artifactId>
        <version>3.3.0</version>
        <exclusions>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-report-plugin</artifactId>
        <version>3.9.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.4.5</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <!-- select non-aggregate reports -->
              <report>report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>checkstyle</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <distributionManagement>
    <site>
      <id>report</id>
      <url>https://mycila.carbou.me/license-maven-plugin/reports/${project.version}</url>
    </site>
  </distributionManagement>

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.4.1</version>
          <configuration>
            <rules>
              <enforceBytecodeVersion>
                <maxJdkVersion>${java.version}</maxJdkVersion>
              </enforceBytecodeVersion>
            </rules>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>extra-enforcer-rules</artifactId>
              <version>1.7.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.6.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.1.2</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.6.0</version>
          <configuration>
            <streamLogsOnFailures>true</streamLogsOnFailures>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.apache.groovy</groupId>
              <artifactId>groovy</artifactId>
              <version>${groovy.version}</version>
            </dependency>
            <dependency>
              <groupId>org.apache.groovy</groupId>
              <artifactId>groovy-json</artifactId>
              <version>${groovy.version}</version>
            </dependency>
            <dependency>
              <groupId>org.apache.groovy</groupId>
              <artifactId>groovy-nio</artifactId>
              <version>${groovy.version}</version>
            </dependency>
            <dependency>
              <groupId>org.apache.groovy</groupId>
              <artifactId>groovy-xml</artifactId>
              <version>${groovy.version}</version>
            </dependency>
          </dependencies>
        </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-gpg-plugin</artifactId>
          <version>3.1.0</version>
          <configuration>
            <useAgent>true</useAgent>
            <keyname>${gpg.keyname}</keyname>
            <passphrase>${gpg.passphrase}</passphrase>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.9.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.3.0</version>
          <configuration>
            <configLocation>.config/checkstyle.xml</configLocation>
            <consoleOutput>true</consoleOutput>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>10.12.3</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>4.2</version>
          <configuration>
            <licenseSets>
              <licenseSet>
                <inlineHeader>
                  <![CDATA[
Copyright (C) ${year} ${owner} (${email})

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

        https://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.
]]>
                </inlineHeader>
                <properties>
                  <owner>Mycila</owner>
                  <year>${project.inceptionYear}-2023</year>
                  <email>mathieu.carbou@gmail.com</email>
                </properties>
                <excludes>
                  <exclude>src/test/resources/**</exclude>
                  <exclude>**/release-pom.xml</exclude>
                  <exclude>docs/**</exclude>
                  <exclude>.config/**</exclude>
                </excludes>
              </licenseSet>
            </licenseSets>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.0.1</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>2.0.1</version>
          <configuration>
            <tag>${project.artifactId}-${project.version}</tag>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.11.0</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy-eclipse-compiler</artifactId>
              <version>3.7.0</version>
            </dependency>
            <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy-eclipse-batch</artifactId>
              <version>3.0.8-01</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.10</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.2.1</version>
          <executions>
            <execution>
              <goals>
                <!-- fix for jacoco -->
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>INSTRUCTION</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>${jacoco.minimum.coverage}</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <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-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
          <execution>
            <id>enforce-clean</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>pre-clean</phase>
          </execution>
          <execution>
            <id>enforce-site</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>pre-site</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>fast</id>
      <activation>
        <property>
          <name>fast</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-maven</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <executions>
              <execution>
                <id>validate</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>report</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>check</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-helpmojo</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- activate release flag for Eclipse compiler compliance when in Eclipse environment -->
      <id>m2e</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <properties>
        <maven.compiler.release>8</maven.compiler.release>
      </properties>
    </profile>
    <profile>
      <!-- activate release flag for compiler compliance when building with JDK 9 or later -->
      <id>jdk-release-flag</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <properties>
        <maven.compiler.release>8</maven.compiler.release>
      </properties>
    </profile>
    <profile>
      <id>report</id>
      <activation>
        <os>
          <family>unix</family>
        </os>
      </activation>
      <reporting>
        <outputDirectory>docs/reports/${project.version}</outputDirectory>
      </reporting>
    </profile>
  </profiles>

</project>
