<?xml version="1.0"?>
<!--

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You 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

       http://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 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-jcs3</artifactId>
    <version>3.2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>commons-jcs3-core</artifactId>
  <version>3.2</version>
  <packaging>jar</packaging>

  <name>Apache Commons JCS :: Core</name>

  <scm>
    <connection>scm:git:http://gitbox.apache.org/repos/asf/commons-jcs.git</connection>
    <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/commons-jcs.git</developerConnection>
    <url>https://gitbox.apache.org/repos/asf?p=commons-jcs.git</url>
    <tag>commons-jcs3-3.2-rc1</tag>
  </scm>

  <properties>
     <commons.bc.version>3.1</commons.bc.version>
     <!-- generate report even if there are binary incompatible changes -->
     <commons.japicmp.breakBuildOnBinaryIncompatibleModifications>false</commons.japicmp.breakBuildOnBinaryIncompatibleModifications>
     <commons.japicmp.ignoreMissingClasses>false</commons.japicmp.ignoreMissingClasses>
     <japicmp.skip>false</japicmp.skip>
     <commons.osgi.import>
         javax.servlet.*;resolution:=optional,
         org.apache.commons.dbcp2.*;resolution:=optional,
         org.apache.http.*;resolution:=optional,
         org.apache.logging.log4j.*;resolution:=optional
     </commons.osgi.import>
     <project.build.outputTimestamp>2023-08-22T10:45:18Z</project.build.outputTimestamp>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.20.0</version>
      <optional>true</optional>
    </dependency>

    <!--  JDBC DISK CACHE -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-dbcp2</artifactId>
      <optional>true</optional>
    </dependency>

    <!--  JDBC DISK CACHE -->
    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <scope>test</scope>
    </dependency>

    <!--  For comparative performance tests only -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <scope>test</scope>
    </dependency>

    <!--  Test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Exclude for now -->
    <!-- dependency>
      <groupId>org.jgroups</groupId>
      <artifactId>jgroups</artifactId>
      <version>3.4.1.Final</version>
      <optional>true</optional>
    </dependency -->

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <optional>true</optional>
    </dependency>
  </dependencies>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/test-conf</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.ccf</include>
        </includes>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${commons.surefire.version}</version>
          <configuration>
            <argLine>-Xmx256m</argLine>
            <forkCount>1</forkCount>
            <reuseForks>false</reuseForks>
            <includes>
              <include>**/*UnitTest.java</include>
            </includes>
            <excludes>
              <!-- Fails in Jenkins -->
              <exclude>**/UDPDiscoveryUnitTest.java</exclude>
              <exclude>**/UDPDiscoverySenderUnitTest.java</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>${commons.rat.version}</version>
          <configuration>
            <excludes combine.children="append">
              <exclude>**/zipcodes.txt</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  
  <profiles>
    <profile>
      <id>testWithJUL</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <java.security.manager>true</java.security.manager>
                <java.security.policy>${basedir}/src/test/conf/cache.policy</java.security.policy>
                <java.util.logging.config.file>${basedir}/src/test/test-conf/logging.properties</java.util.logging.config.file>
              </systemPropertyVariables>              
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>testWithLog4j2</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-core</artifactId>
          <version>2.20.0</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <java.security.manager>true</java.security.manager>
                <java.security.policy>${basedir}/src/test/conf/cache.policy</java.security.policy>
                <jcs.logSystem>log4j2</jcs.logSystem>
                <log4j.configurationFile>src/test/test-conf/log4j2-test.xml</log4j.configurationFile>
              </systemPropertyVariables>              
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
