<?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>kp-commons-vfs</artifactId>
  <version>2.0-SNAPSHOT</version>
  <description>VFS is a Virtual File System library with a special modification for Alfresco FTP (FtpClient class).</description>

	<!-- where can maven find other artifacts -->
	<repositories>
		<repository>
			<id>kp</id>
			<url>http://www.softworks.nl:8081/nexus/content/groups/public</url>
			<!-- this server must be defined in ~/.m2/setting.xml with a username and password	 http://maven.apache.org/settings.html#Servers -->
		</repository>
		<repository>
			<id>kp-snapshots</id>
			<url>http://www.softworks.nl:8081/nexus/content/groups/public-snapshots</url>
			<!-- this server must be defined in ~/.m2/setting.xml with a username and password	 http://maven.apache.org/settings.html#Servers -->
		</repository>
	</repositories>

	<!-- where can maven find plugins -->
	<pluginRepositories>
		<pluginRepository>
			<id>kp</id>
			<url>http://www.softworks.nl:8081/nexus/content/groups/public</url>
			<!-- this server must be defined in ~/.m2/setting.xml with a username and password	 http://maven.apache.org/settings.html#Servers -->
		</pluginRepository>
	</pluginRepositories>
	
	<dependencies>
	  <!-- 3rd party dependencies -->
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
      </dependency>
      <dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>1.4.1</version>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.1</version>
      </dependency>
      <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.0</version>
        <!-- JCR-683: Exclude bad transitive dependencies, check again when upgrading version -->
        <exclusions>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>1.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.jackrabbit</groupId>
        <artifactId>jackrabbit-webdav</artifactId>
        <version>1.5.2</version>
      </dependency>
      <dependency>
        <groupId>ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.6.2</version>
      </dependency>
      <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>1.0.b2</version>
      </dependency>
      <dependency>
        <groupId>org.jdom</groupId>
        <artifactId>jdom</artifactId>
        <version>1.1</version>
      </dependency>
      <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>0.1.42</version>
      </dependency>
      <dependency>
        <groupId>jcifs</groupId>
        <artifactId>jcifs</artifactId>
        <version>0.8.3</version>
      </dependency>
      <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.2</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>src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>..</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>NOTICE.txt</include>
        </includes>
      </testResource>
      <testResource>
        <directory>..</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </testResource>
    </testResources>

    <plugins>
			<!-- copy all dependency jars to a directory (for eclipse without m2eclipse)  -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<!-- run the copy-dependencies goal of the plugin as part of the initialize phase of the build using the specified configuration-->
					<execution>
						<id>collect libs for EDI</id>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<phase>initialize</phase>
						<configuration>
								<outputDirectory>
										${project.build.directory}/lib
								</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
      <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>

  	<!-- configure how the artifacts are released -->
	<distributionManagement>
		<repository>
			<id>kp</id>
			<url>http://www.softworks.nl:8081/nexus/content/repositories/releases/</url>
			<uniqueVersion>false</uniqueVersion>
			<releases> <updatePolicy>always</updatePolicy> </releases>
		</repository>
		<snapshotRepository>
			<id>kp-snapshots</id>
			<url>http://www.softworks.nl:8081/nexus/content/repositories/snapshots/</url>
			<uniqueVersion>false</uniqueVersion>
			<snapshots> <updatePolicy>always</updatePolicy> </snapshots>
		</snapshotRepository>
	</distributionManagement>	
	
</project>
