<?xml version="1.0" encoding="UTF-8"?>

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

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-vfs2-project</artifactId>
    <version>2.10.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <name>Apache Commons VFS HDFS</name>
  <artifactId>commons-vfs2-hdfs</artifactId>
  <packaging>jar</packaging>
  <description>Apache Commons VFS is a Virtual File System library - Apache Hadoop HDFS provider.</description>

  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-vfs2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j2-impl</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-vfs2</artifactId>
       <type>test-jar</type>
       <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- Test HDFS with Apache Hadoop -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
         <!-- VFS-606 - tools.jar not available in Java 9
              This exclusion can be removed after upgrading Hadoop
              to 2.7.1 or later  
          -->
          <groupId>jdk.tools</groupId>
          <artifactId>jdk.tools</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <properties>
    <commons.parent.dir>${basedir}/..</commons.parent.dir>
    <commons.packageId>vfs2-hdfs</commons.packageId>
    <commons.module.name>org.apache.commons.vfs2.hdfs</commons.module.name>
    <commons.osgi.import>
        org.apache.hadoop.*;resolution:=optional,
        *
    </commons.osgi.import>
    <!-- Hadoop jars contain overlapping packages that blow up JPMS -->
    <moditect.skip>true</moditect.skip>
    <project.build.outputTimestamp>2025-02-01T21:47:58Z</project.build.outputTimestamp>
  </properties>

  <build>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
      </resource>
      <resource>
        <directory>${commons.parent.dir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>NOTICE.txt</include>
          <include>LICENSE.txt</include>
        </includes>
      </resource>
    </resources>
     <!-- include NOTICE/LICENSE in generated test jar -->
    <testResources>
      <testResource>
        <directory>${project.basedir}/src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>${commons.parent.dir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>NOTICE.txt</include>
          <include>LICENSE.txt</include>
        </includes>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- surfire do not honor suite(), see MSUREFIRE-131 why our tests wont work with maven 2 -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <test.basedir>target/test-classes/test-data</test.basedir>
            <test.basedir.res>test-data</test.basedir.res>
            <derby.stream.error.file>target/derby.log</derby.stream.error.file>
          </systemPropertyVariables>
          <excludes>
            <!-- Need to port fully to JUnit 4 or 5. -->
            <!-- *Tests.java files with @Test methods should not be run since these classes are in fact JUnit 3 classes used in custom JUnit 3 test suites. -->
            <exclude>**/*Tests.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
		<!-- Remove after 2.10.0 -->
        <groupId>com.github.siom79.japicmp</groupId>
        <artifactId>japicmp-maven-plugin</artifactId>
        <configuration>
          <oldVersion>
            <dependency>
              <groupId>org.apache.commons</groupId>
              <artifactId>commons-vfs2</artifactId>
              <version>${commons.bc.version}</version>
              <type>jar</type>
            </dependency>
          </oldVersion>
          <parameter>
            <includes>
              <!--  Package moved to new module here -->
              <include>org.apache.commons.vfs2.provider.hdfs</include>
            </includes>
          </parameter>
          <dependencies>
            <dependency>
              <groupId>org.apache.commons</groupId>
              <artifactId>commons-collections4</artifactId>
              <version>${collections4.version}</version>
            </dependency>
            <dependency>
              <groupId>com.jcraft</groupId>
              <artifactId>jsch</artifactId>
             <version>${jsch.version}</version>
            </dependency>
            <dependency>
              <groupId>org.apache.ant</groupId>
              <artifactId>ant</artifactId>
             <version>${ant.version}</version>
            </dependency>
            <dependency>
              <groupId>commons-httpclient</groupId>
              <artifactId>commons-httpclient</artifactId>
             <version>${httpclient3.version}</version>
            </dependency>
		  </dependencies>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
		<!-- Remove after 2.10.0 -->
        <groupId>com.github.siom79.japicmp</groupId>
        <artifactId>japicmp-maven-plugin</artifactId>
        <configuration>
          <oldVersion>
            <dependency>
              <groupId>org.apache.commons</groupId>
              <artifactId>commons-vfs2</artifactId>
              <version>${commons.bc.version}</version>
              <type>jar</type>
            </dependency>
          </oldVersion>
          <parameter>
            <includes>
              <!--  Package moved to new module here -->
              <include>org.apache.commons.vfs2.provider.hdfs</include>
            </includes>
          </parameter>
          <dependencies>
            <dependency>
              <groupId>org.apache.commons</groupId>
              <artifactId>commons-collections4</artifactId>
              <version>${collections4.version}</version>
            </dependency>
            <dependency>
              <groupId>com.jcraft</groupId>
              <artifactId>jsch</artifactId>
             <version>${jsch.version}</version>
            </dependency>
            <dependency>
              <groupId>ant</groupId>
              <artifactId>ant</artifactId>
             <version>${ant.version}</version>
            </dependency>
            <dependency>
              <groupId>commons-httpclient</groupId>
              <artifactId>commons-httpclient</artifactId>
             <version>${httpclient3.version}</version>
            </dependency>
		  </dependencies>
        </configuration>
      </plugin>
	</plugins>
  </reporting>
  <profiles>
    <profile>
      <!-- Java 23 and up -->
      <id>java-23-up</id>
      <activation>
        <jdk>[23,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>-Djava.security.manager=allow</argLine>
             </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <activation>
        <os>
          <family>Windows</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/Hdfs*Test*.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>  
</project>
