<!--

    Copyright (C) 2008-2024 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>

  <groupId>com.mycila</groupId>
  <artifactId>license-maven-plugin-parent</artifactId>
  <version>4.6</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://oss.carbou.me/license-maven-plugin/reports/${project.version}</url>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/mathieucarbou/license-maven-plugin/issues</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub</system>
    <url>https://github.com/mathieucarbou/license-maven-plugin/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>

    <groovy.version>4.0.23</groovy.version>
    <jacoco.minimum.coverage>1.00</jacoco.minimum.coverage>
    <junit.version>5.11.0</junit.version>
    <maven.version>3.9.9</maven.version>
    <maven-plugin.version>3.15.0</maven-plugin.version>
    <surefire.version>3.5.0</surefire.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>

  <organization>
    <name>Mathieu Carbou</name>
    <url>https://oss.carbou.me/</url>
  </organization>

  <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>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:https://github.com/mathieucarbou/license-maven-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:mycila/license-maven-plugin.git</developerConnection>
    <url>https://github.com/mathieucarbou/license-maven-plugin</url>
    <tag>license-maven-plugin-4.6</tag>
  </scm>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>${maven-plugin.version}</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>4.0.0-alpha-2</version>
      </dependency>

      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-report-plugin</artifactId>
        <version>${maven-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.7.0</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>
    <repository>
      <id>mycila-oss-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>mycila-oss-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
    <site>
      <id>report</id>
      <url>https://oss.carbou.me/license-maven-plugin/reports/${project.version}</url>
    </site>
  </distributionManagement>

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.4.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.5.0</version>
          <configuration>
            <rules>
              <enforceBytecodeVersion>
                <maxJdkVersion>${java.version}</maxJdkVersion>
              </enforceBytecodeVersion>
              <requireMavenVersion>
                <version>(3.6.3,)</version>
                <message>Require maven 3.6.3 or better.</message>
              </requireMavenVersion>
            </rules>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>extra-enforcer-rules</artifactId>
              <version>1.9.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.1.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.4.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.10.0</version>
          <configuration>
            <additionalOptions>
              <additionalOption>-html5</additionalOption>
            </additionalOptions>
            <legacyMode>true</legacyMode>
            <notimestamp>true</notimestamp>
            <release>${java.release.version}</release>
            <source>${java.version}</source>
            <quiet>true</quiet>
            <links>
                <link>https://docs.oracle.com/javase/8/docs/api/</link>
            </links>
          </configuration>
        </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>${surefire.version}</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${surefire.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.8.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.20.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.2.6</version>
          <configuration>
            <useAgent>true</useAgent>
            <keyname>${gpg.keyname}</keyname>
            <passphrase>${gpg.passphrase}</passphrase>
            <useAgent>false</useAgent>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${maven-plugin.version}</version>
          <configuration>
            <detail>true</detail>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.5.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.18.1</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>4.5</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}-2024</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>
                  <!-- TODO: Remove after 4.4 release -->
                  <exclude>**/*.checkstyle</exclude>
                </excludes>
              </licenseSet>
            </licenseSets>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.1.1</version>
          <configuration>
            <arguments>-Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5</arguments>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <releaseProfiles>release</releaseProfiles>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>2.1.0</version>
          <configuration>
            <tag>${project.artifactId}-${project.version}</tag>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.13.0</version>
          <configuration>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
          </configuration>
          <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.12</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.3.1</version>
        </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-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</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>report</id>
      <activation>
        <os>
          <family>unix</family>
        </os>
      </activation>
      <reporting>
        <outputDirectory>docs/reports/${project.version}</outputDirectory>
      </reporting>
    </profile>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <reporting>
        <outputDirectory>docs/reports/${project.version}</outputDirectory>
      </reporting>
      <build>
        <plugins>
          <!-- Skip license plugin during release as maven release is now shallow cloned -->
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.20.0</version>
            <configuration>
              <skipDeploy>true</skipDeploy>
            </configuration>
          </plugin>
          <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>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
