<?xml version="1.0" encoding="UTF-8"?>
<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>com.itextpdf.licensing</groupId>
  <artifactId>licensing-root</artifactId>
  <version>4.2.5</version>
  <packaging>pom</packaging>

  <name>iText - Licensing Library Root</name>

  <modules>
    <module>licensing-base</module>
    <module>licensing-remote</module>
    <module>licensing-base-standalone-test</module>
  </modules>

  <url>https://itextpdf.com/</url>

  <properties>
    <argLine />
    <dependencyCheck.version>7.0.0</dependencyCheck.version>
    <itext.version>9.5.0</itext.version>
    <java.version>1.8</java.version>
    <javadoc-additionalOptions />
    <javadoc-link>https://docs.oracle.com/javase/8/docs/api/</javadoc-link>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <sonar.dependencyCheck.htmlReportPath>${project.build.directory}/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath>
    <sonar.dependencyCheck.reportPath>${project.build.directory}/dependency-check-report.xml</sonar.dependencyCheck.reportPath>

    <sharpen.builddotnet>false</sharpen.builddotnet>
    <sharpen.showdiff>false</sharpen.showdiff>
    <sharpen.phase>none</sharpen.phase>
    <sharpen.projectName>empty</sharpen.projectName>
    <sharpen.cSharpTargetFolder>empty</sharpen.cSharpTargetFolder>
    <sharpen.cSharpSourceCodeDestination />
    <sharpen.cSharpTestCodeDestination />

  </properties>
  <pluginRepositories>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>itext-releases</id>
      <name>iText Repository - releases</name>
      <url>https://repo.itextsupport.com/artifactory/releases</url>
    </pluginRepository>
  </pluginRepositories>

  <repositories>
    <repository>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>itext-snapshot</id>
      <name>iText Repository - snapshots</name>
      <url>https://repo.itextsupport.com/snapshot</url>
    </repository>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>itext-releases</id>
      <name>iText Repository - releases</name>
      <url>https://repo.itextsupport.com/releases</url>
    </repository>
  </repositories>

  <build>
    <finalName>itext-${project.artifactId}-${project.version}</finalName>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>4.2.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
        </plugin>
        <!-- Run integration tests -->
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <!-- Run unit tests -->
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <groupId>org.pitest</groupId>
          <artifactId>pitest-maven</artifactId>
          <version>1.5.1</version>
          <executions>
            <execution>
              <id>default-mutationCoverage</id>
              <goals>
                <goal>mutationCoverage</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <timestampedReports>false</timestampedReports>
            <outputFormats>
              <outputFormat>XML</outputFormat>
              <outputFormat>HTML</outputFormat>
            </outputFormats>
            <targetClasses>
              <param>com.itextpdf*</param>
            </targetClasses>
            <targetTests>
              <param>com.itextpdf*</param>
            </targetTests>
            <historyInputFile>${project.build.directory}/pitest.history</historyInputFile>
            <historyOutputFile>${project.build.directory}/pitest.history</historyOutputFile>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>sharpen</groupId>
        <artifactId>sharpen-maven-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>5.1.1</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <unpackBundle>true</unpackBundle>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <!-- Run integration tests -->
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
          <threadCount>1</threadCount>
          <argLine>@{argLine}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <failOnError>false</failOnError>
          <quiet>true</quiet>
          <source>8</source>
          <detectLinks>true</detectLinks>
          <additionalOptions>${javadoc-additionalOptions}</additionalOptions>
          <links>
            <link>${javadoc-link}</link>
          </links>
          <!--Be aware, if we add something in javadoc-plugin we need to add it also in japicmp-plugin-->
          <sourceFileIncludes>
            <sourceFileInclude>com/itextpdf/licensing/base/LicenseKey.java</sourceFileInclude>
            <sourceFileInclude>com/itextpdf/licensing/base/reporting/LicenseKeyReportingConfigurer.java</sourceFileInclude>
            <sourceFileInclude>com/itextpdf/licensing/base/exceptions/LicenseKeyException.java</sourceFileInclude>
            <sourceFileInclude>com/itextpdf/licensing/base/exceptions/LicenseKeyExceptionMessageConstant.java</sourceFileInclude>
            <sourceFileInclude>com/itextpdf/licensing/base/logs/LicenseKeyLogMessageConstant.java</sourceFileInclude>
            <sourceFileInclude>com/itextpdf/licensing/base/info/**/*.java</sourceFileInclude>
            <sourceFileInclude>com/itextpdf/licensing/remote/LicenseKeyRemoteConfigurer.java</sourceFileInclude>
           <!-- **\ / \*.java-->
          </sourceFileIncludes>
        </configuration>
      </plugin>
      <!-- Run unit tests -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.2.5</version>
            <scope>compile</scope>
          </dependency>
        </dependencies>
        <configuration>
          <argLine>@{argLine}</argLine>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>sortpom</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.ekryd.sortpom</groupId>
            <artifactId>sortpom-maven-plugin</artifactId>
            <version>2.11.0</version>
            <executions>
              <execution>
                <phase>clean</phase>
                <goals>
                  <goal>sort</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <encoding>${project.build.sourceEncoding}</encoding>
              <expandEmptyElements>false</expandEmptyElements>
              <sortDependencies>scope,groupId,artifactId</sortDependencies>
              <sortPlugins>groupId,artifactId</sortPlugins>
              <sortProperties>true</sortProperties>
              <sortModules>true</sortModules>
              <createBackupFile>false</createBackupFile>
              <lineSeparator>\n</lineSeparator>
              <keepBlankLines>true</keepBlankLines>
              <nrOfIndentSpace>2</nrOfIndentSpace>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>tidy-maven-plugin</artifactId>
            <version>1.1.0</version>
            <executions>
              <execution>
                <phase>clean</phase>
                <goals>
                  <goal>pom</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- This profile is only used by Jenkins and assumes that main classes have already been compiled. -->
      <id>qa</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.siom79.japicmp</groupId>
            <artifactId>japicmp-maven-plugin</artifactId>
            <version>0.15.4</version>
            <executions>
              <execution>
                <phase>verify</phase>
                <goals>
                  <goal>cmp</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <newVersion>
                <file>
                  <path>${project.build.directory}/itext-${project.artifactId}-${project.version}.${project.packaging}</path>
                </file>
              </newVersion>
              <parameter>
                <onlyModified>true</onlyModified>
                <onlyBinaryIncompatible>true</onlyBinaryIncompatible>
                <ignoreMissingClasses>true</ignoreMissingClasses>
                <!--The same files as in javadoc-plugin-->
                <includes>
                  <include>com.itextpdf.licensing.base.LicenseKey</include>
                  <include>com.itextpdf.licensing.base.reporting.LicenseKeyReportingConfigurer</include>
                  <include>com.itextpdf.licensing.base.exceptions.LicenseKeyException</include>
                  <include>com.itextpdf.licensing.base.exceptions.LicenseKeyExceptionMessageConstant</include>
                  <include>com.itextpdf.licensing.base.logs.LicenseKeyLogMessageConstant</include>
                  <include>com.itextpdf.licensing.base.info</include>
                  <include>com.itextpdf.licensing.remote.LicenseKeyRemoteConfigurer</include>
                </includes>
              </parameter>
              <!-- TODO DEVSIX-8520 Enable japicmp after 9.0.0 release -->
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <executions>
              <execution>
                <id>bundle-manifest</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>default-compile</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>default-testCompile</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <id>default</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <id>default-jar</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>default-resources</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>default-testResources</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>default-test</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.owasp</groupId>
            <artifactId>dependency-check-maven</artifactId>
            <version>${dependencyCheck.version}</version>
            <dependencies>
              <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>8.0.33</version>
              </dependency>
            </dependencies>
            <configuration>
              <autoUpdate>false</autoUpdate>
              <connectionString />
              <databaseDriverName>com.mysql.cj.jdbc.Driver</databaseDriverName>
              <databasePassword />
              <databaseUser />
              <format>ALL</format>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- This profile is only used by Jenkins and assumes that main classes have already been compiled. -->
      <id>test-with-coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <executions>
              <execution>
                <id>bundle-manifest</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>default-compile</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <id>default-jar</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>default-resources</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <!-- Compute test coverage for Sonar BEWARE: Sonar
      doesn't run the verify phase, it has to be forced by setting -Dsonar.phase=verify -->
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.5</version>
            <executions>
              <execution>
                <id>default-prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>default-report</id>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <includes>
                <include>com/itextpdf/**</include>
              </includes>
              <jmx>true</jmx>
              <!-- jmx is set to true as a workaround for the code coverage measurement problem with upgrade
              to junit 4.13.2. See more in DEVSIX-4761. With the future jacoco/junit upgrades the necessity in
              setting this parameter might fade. It's not used for anything else but making sure code coverage is
              measured correctly. -->
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- This profile is only used by Jenkins. -->
      <id>mutationtest</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
          </plugin>
        </plugins>
      </build>
      <properties>
        <sonar.pitest.mode>reuseReport</sonar.pitest.mode>
      </properties>
    </profile>
    <profile>
      <!-- This profile is only used by Jenkins and assumes that main classes have already been compiled. -->
      <id>artifactory</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <executions>
              <execution>
                <id>bundle-manifest</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>default-compile</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>default-testCompile</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <id>default</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>default-resources</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>default-testResources</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>default-test</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>build-sharpen-configs</id>
      <dependencies>
        <dependency>
          <groupId>sharpen</groupId>
          <artifactId>sharpen-config</artifactId>
          <version>1.0-SNAPSHOT</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>sharpen</groupId>
          <artifactId>standard-framework-mapping</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.6.0</version>
            <executions>
              <execution>
                <id>add-sharpenConfiguration-source</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                  <goal>add-resource</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>${project.basedir}/src/sharpenconfig/java</source>
                  </sources>
                  <resources>
                    <resource>
                      <directory>${project.basedir}/src/sharpenconfig/resources</directory>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.4.2</version>
            <executions>
              <execution>
                <id>sharpen-config-jar</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <classifier>sharpen-configuration</classifier>
                  <includes>
                    <include>**/SharpenConfig*.class</include>
                    <include>**/sharpen.config.MappingConfiguration</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>with-sharpen</id>
      <dependencies>
        <dependency>
          <groupId>sharpen</groupId>
          <artifactId>sharpen-config</artifactId>
          <version>1.0-SNAPSHOT</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>sharpen</groupId>
          <artifactId>standard-framework-mapping</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.6.0</version>
            <executions>
              <execution>
                <id>add-sharpenConfiguration-source</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                  <goal>add-resource</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>${project.basedir}/src/sharpenconfig/java</source>
                  </sources>
                  <resources>
                    <resource>
                      <directory>${project.basedir}/src/sharpenconfig/resources</directory>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.4.2</version>
            <executions>
              <execution>
                <id>sharpen-config-jar</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <classifier>sharpen-configuration</classifier>
                  <includes>
                    <include>**/SharpenConfig*.class</include>
                    <include>**/sharpen.config.MappingConfiguration</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>sharpen</groupId>
              <artifactId>sharpen-maven-plugin</artifactId>
              <executions>
                <execution>
                  <phase>${sharpen.phase}</phase>
                  <goals>
                    <goal>sharpen</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <buildDotnet>${sharpen.builddotnet}</buildDotnet>
                <showDiff>${sharpen.showdiff}</showDiff>
                <projectName>${sharpen.projectName}</projectName>
                <cSharpTargetFolder>${sharpen.cSharpTargetFolder}</cSharpTargetFolder>
                <cSharpSourceCodeDestination>${sharpen.cSharpSourceCodeDestination}</cSharpSourceCodeDestination>
                <cSharpTestCodeDestination>${sharpen.cSharpTestCodeDestination}</cSharpTestCodeDestination>
                <sourceCodeFiles>
                  <file>**/src/main/java/**/*.java</file>
                </sourceCodeFiles>
                <testCodeFiles>
                  <file>**/src/test/java/**/*.java</file>
                </testCodeFiles>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>sharpen-configuration</id>
      <activation>
        <file>
          <missing>noSharpen.txt</missing>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.4.2</version>
            <executions>
              <execution>
                <id>default-jar</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <excludes>
                    <exclude>**/SharpenConfig*.class</exclude>
                    <exclude>**/sharpen.config.MappingConfiguration</exclude>
                  </excludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>