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

  <modelVersion>4.0.0</modelVersion>

  <name>Commons VFS Core</name>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-vfs</artifactId>
  <version>2.0-SNAPSHOT</version>
  <description>VFS is a Virtual File System library.</description>

  <parent>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-vfs-project</artifactId>
    <version>2.0-SNAPSHOT</version>
    <relativePath>../</relativePath>
  </parent>

  <dependencies>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.0.4</version>
    </dependency>
    <dependency>
      <groupId>ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.6.2</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>commons-net</groupId>
      <artifactId>commons-net</artifactId>
      <version>1.4.1</version>
      <optional>true</optional>
    </dependency>
    <!--TODO:Revert to [compress] if/when released
       <dependency>
         <groupId>commons-compress</groupId>
         <artifactId>commons-compress</artifactId>
         <version>SNAPSHOT</version>
         <optional>true</optional>
       </dependency-->
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.1</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>jdom</groupId>
      <artifactId>jdom</artifactId>
      <version>1.0</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.0</version>
      <!-- JCR-683: Exclude bad transitive dependencies -->
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-webdav</artifactId>
      <version>1.5.2</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.jcraft</groupId>
      <artifactId>jsch</artifactId>
      <version>0.1.31</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
      <version>1.0.b2</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>oro</groupId>
      <artifactId>oro</artifactId>
      <version>2.0.8</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>..</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>NOTICE.txt</include>
        </includes>
      </resource>
      <resource>
        <directory>..</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </resource>
    </resources>

    <!-- include NOTICE/LICENSE in generated test jar -->
    <testResources>
      <testResource>
        <directory>..</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>NOTICE.txt</include>
        </includes>
      </testResource>
      <testResource>
        <directory>..</directory>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </testResource>
      <testResource>
        <directory>src/test/test-data</directory>
        <targetPath>test-data</targetPath>
        <excludes>
          <exclude>code/**/*.java</exclude>
        </excludes>
      </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>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-test-classes</phase>
            <configuration>
              <tasks>
                <move todir="${project.build.testOutputDirectory}/test-data/code"
                      failonerror="false">
                  <fileset dir="${project.build.testOutputDirectory}/code"/>
                </move>

              </tasks>
            </configuration>
            <goals>
              <goal>run</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>
          <systemProperties>
            <property>
              <name>test.basedir</name>
              <value>target/test-classes/test-data</value>
            </property>
            <property>
              <name>test.basedir.res</name>
              <value>test-data</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>

    </plugins>
  </build>
  <profiles>
    <profile>
      <id>webdav</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
          <version>1.5.6</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
          <version>1.5.6</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>test.basedir</name>
                  <value>target/test-classes/test-data</value>
                </property>
                <property>
                  <name>test.basedir.res</name>
                  <value>test-data</value>
                </property>
                <property>
                  <name>test.webdav.uri</name>
                  <value>${test.webdav.uri}</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ftp</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>test.basedir</name>
                  <value>target/test-classes/test-data</value>
                </property>
                <property>
                  <name>test.basedir.res</name>
                  <value>test-data</value>
                </property>
                <property>
                  <name>test.ftp.uri</name>
                  <value>${test.ftp.uri}</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sftp</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>test.basedir</name>
                  <value>target/test-classes/test-data</value>
                </property>
                <property>
                  <name>test.basedir.res</name>
                  <value>test-data</value>
                </property>
                <property>
                  <name>test.sftp.uri</name>
                  <value>${test.sftp.uri}</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>http</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>test.basedir</name>
                  <value>target/test-classes/test-data</value>
                </property>
                <property>
                  <name>test.basedir.res</name>
                  <value>test-data</value>
                </property>
                <property>
                  <name>test.http.uri</name>
                  <value>${test.http.uri}</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
