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

  <groupId>org.apache.xmlgraphics</groupId>
  <artifactId>xmlgraphics-commons</artifactId>
  <version>2.10</version>
  <name>Apache XML Graphics Commons</name>
  <description>XML Graphics Common Support</description>
  <url>http://xmlgraphics.apache.org/commons/</url>

  <properties>
    <checkstyle.version>2.15</checkstyle.version>
    <exec.version>1.4.0</exec.version>
    <findbugs.version>4.7.3.6</findbugs.version>
    <jacoco.version>0.8.7</jacoco.version>
    <java.version>1.8</java.version>
    <junit.version>4.13.2</junit.version>
    <project.info.reports.version>2.8</project.info.reports.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <release.version>2.5.2</release.version>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.organization>apache</sonar.organization>
    <surefire.version>2.18.1</surefire.version>
    <jdk.path>${env.JAVA_HOME}</jdk.path>
  </properties>

  <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>
    <connection>scm:git:https://gitbox.apache.org/repos/asf/xmlgraphics-commons.git</connection>
    <url>scm:git:https://gitbox.apache.org/repos/asf/xmlgraphics-commons.git</url>
    <developerConnection></developerConnection>
  </scm>

  <organization>
    <name>Apache Software Foundation</name>
    <url>http://www.apache.org/</url>
  </organization>

  <distributionManagement>
    <site>
      <id>${project.artifactId}-site</id>
      <url>${project.baseUri}</url>
    </site>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.11.0</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.28.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>xml-resolver</groupId>
      <artifactId>xml-resolver</artifactId>
      <version>1.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
          </configuration>
        </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-project-info-reports-plugin</artifactId>
          <version>${project.info.reports.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>org.apache.xmlgraphics.commons</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>    
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle.version}</version>
        <configuration>
          <configLocation>${project.baseUri}src/tools/resources/checkstyle/checkstyle.xml</configLocation>
          <headerLocation>${project.baseUri}src/tools/resources/checkstyle/LICENSE.txt</headerLocation>
          <suppressionsLocation>${project.baseUri}src/tools/resources/checkstyle/suppressions.xml</suppressionsLocation> 
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <includeResources>false</includeResources>
          <includeTestResources>false</includeTestResources>
          <violationSeverity>warning</violationSeverity>
          <consoleOutput>true</consoleOutput>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${findbugs.version}</version>
        <configuration>
          <excludeFilterFile>src/tools/resources/findbugs/exclusions.xml</excludeFilterFile>
          <effort>Max</effort>
          <threshold>Low</threshold>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire.version}</version><!--$NO-MVN-MAN-VER$-->
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
        </configuration>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
        <targetPath>META-INF</targetPath>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <!-- TBD - move following *.{png,tiff,txt,xmp} into test/resources, then remove these rules -->
        <directory>src/test/java</directory>
        <includes>
          <include>**/*.png</include>
          <include>**/*.tiff</include>
          <include>**/*.txt</include>
          <include>**/*.xmp</include>
        </includes>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
        <includes>
          <include>**/*</include>
        </includes>
      </testResource>
    </testResources>
  </build>
  
  <profiles>
    <profile>
      <id>custom-javac</id>
      <activation>
        <property>
          <name>jdk.path</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <executable>${jdk.path}/bin/javac</executable>
                <fork>true</fork>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco.version}</version>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <formats>
                    <format>XML</format>
                  </formats>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>  

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle.version}</version>
        <configuration>
          <configLocation>${project.baseUri}src/tools/resources/checkstyle/checkstyle.xml</configLocation>
          <headerLocation>${project.baseUri}src/tools/resources/checkstyle/LICENSE.txt</headerLocation>
          <includeResources>false</includeResources>
          <includeTestResources>false</includeTestResources>
          <linkXRef>false</linkXRef>
          <suppressionsLocation>${project.baseUri}src/tools/resources/checkstyle/suppressions.xml</suppressionsLocation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${findbugs.version}</version>
        <configuration>
          <excludeFilterFile>src/tools/resources/findbugs/exclusions.xml</excludeFilterFile>
          <effort>Max</effort>
          <spotBugsXmlOutput>true</spotBugsXmlOutput>
          <spotBugsXmlWithMessages>true</spotBugsXmlWithMessages>
          <threshold>Low</threshold>
          <xmlOutput>true</xmlOutput>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

</project>
