<!--
  ~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. 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>
    <groupId>org.wso2.ei</groupId>
    <artifactId>module-ftp</artifactId>
    <packaging>pom</packaging>
    <version>0.100.0</version>
    <name>Ballerina - FTP Module Parent</name>

    <url>https://ballerina.io/</url>

    <modules>
        <module>ftp-utils</module>
        <module>compiler-plugin</module>
        <module>ftp</module>
    </modules>

    <scm>
        <url>https://github.com/wso2-ballerina/module-ftp.git</url>
        <developerConnection>scm:git:https://github.com/wso2-ballerina/module-ftp.git</developerConnection>
        <connection>scm:git:https://github.com/wso2-ballerina/module-ftp.git</connection>
        <tag>HEAD</tag>
    </scm>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>wso2-release</id>
            <build>
                <plugins>
                    <!-- We want to deploy the artifact to a staging location for perusal -->
                    <plugin>
                        <inherited>true</inherited>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- We want to sign the artifact, the POM, and all attached artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ballerina-build</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.6.0</version>
                        <executions>
                            <execution>
                                <id>ballerina-build</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <executable>ballerina</executable>
                            <arguments>
                                <argument>compile</argument>
                            </arguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>wso2.releases</id>
            <name>WSO2 Releases Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </repository>
        <repository>
            <id>wso2.snapshots</id>
            <name>WSO2 Snapshot Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>wso2-nexus</id>
            <name>WSO2 internal Repository</name>
            <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>wso2.releases</id>
            <name>WSO2 Releases Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>wso2.snapshots</id>
            <name>WSO2 Snapshot Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>wso2-nexus</id>
            <name>WSO2 internal Repository</name>
            <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wso2.transport.file</groupId>
                <artifactId>org.wso2.transport.remote-file-system</artifactId>
                <version>${file.transport.version}</version>
            </dependency>
            <dependency>
                <groupId>com.jcraft</groupId>
                <artifactId>jsch</artifactId>
                <version>${jsch.version}</version>
            </dependency>
            <dependency>
                <groupId>org.ballerinalang</groupId>
                <artifactId>ballerina-lang</artifactId>
                <version>${ballerina.version}</version>
            </dependency>
            <dependency>
                <groupId>org.ballerinalang</groupId>
                <artifactId>ballerina-runtime</artifactId>
                <version>${ballerina.version}</version>
            </dependency>
            <dependency>
                <groupId>org.ballerinalang</groupId>
                <artifactId>ballerina-io</artifactId>
                <version>${ballerina.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockftpserver</groupId>
                <artifactId>MockFtpServer</artifactId>
                <version>${mock.ftp.server.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>${maven.wagon.ssh.version}</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven.release.plugin.version}</version>
                <configuration>
                    <preparationGoals>clean install</preparationGoals>
                    <autoVersionSubmodules>false</autoVersionSubmodules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven.deploy.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${wso2.maven.compiler.source}</source>
                    <target>${wso2.maven.compiler.target}</target>
                    <compilerArgument>-proc:none</compilerArgument>
                </configuration>
            </plugin>
            <plugin><!-- Overridden from parent pom to exclude generated sources -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven.checkstyle.plugin.version}</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>
                                https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/checkstyle.xml
                            </configLocation>
                            <suppressionsLocation>
                                https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/suppressions.xml
                            </suppressionsLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <!--Exclude generated sources-->
                            <excludes>
                                **/generated/**
                            </excludes>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- For ballerina annotation processing -->
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>${maven.processor.plugin.version}</version>
                <configuration>
                    <processors>
                        <processor>org.ballerinalang.codegen.BallerinaAnnotationProcessor</processor>
                    </processors>
                    <options>
                        <nativeEntityProviderPackage>
                            org.ballerinalang.ftp.generated.providers
                        </nativeEntityProviderPackage>
                        <nativeEntityProviderClass>StandardNativeElementProvider</nativeEntityProviderClass>
                    </options>
                </configuration>
                <executions>
                    <execution>
                        <id>process</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <version>${maven.remote.resource.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven.resources.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven.shade.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
            </plugin>
        </plugins>
    </build>
    <distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>WSO2 Nexus Release Repository</name>
            <url>http://maven.wso2.org/nexus/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>wso2.snapshots</id>
            <name>WSO2 Snapshot Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <properties>
        <ballerina.version>1.0.0</ballerina.version>
        <docerina.version>${ballerina.version}</docerina.version>
        <file.transport.version>6.0.57</file.transport.version>
        <slf4j.version>1.7.22</slf4j.version>
        <maven.findbugsplugin.version.exclude>findbugs-exclude.xml</maven.findbugsplugin.version.exclude>
        <mock.ftp.server.version>2.7.1</mock.ftp.server.version>
        <testng.version>6.9.4</testng.version>

        <wso2.maven.compiler.source>1.8</wso2.maven.compiler.source>
        <wso2.maven.compiler.target>1.8</wso2.maven.compiler.target>
        <maven.findbugsplugin.version>3.0.3</maven.findbugsplugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.plugin.version>3.5.1</maven.compiler.plugin.version>
        <maven.surefire.plugin.version>2.20.1</maven.surefire.plugin.version>
        <maven.checkstyle.plugin.version>2.17</maven.checkstyle.plugin.version>
        <maven.jacoco.plugin.version>0.7.8</maven.jacoco.plugin.version>
        <maven.dependency.plugin.version>3.0.2</maven.dependency.plugin.version>
        <maven.processor.plugin.version>2.2.4</maven.processor.plugin.version>
        <maven.remote.resource.plugin.version>1.5</maven.remote.resource.plugin.version>
        <docerina.maven.plugin.version>${ballerina.version}</docerina.maven.plugin.version>

        <!--Bundle dependency versions-->
        <commons-vfs2.wso2.version>2.2-wso2v2</commons-vfs2.wso2.version>
        <!--<quartz.version>2.3.0.wso2v2</quartz.version>-->
        <jsch.version>0.1.54</jsch.version>
        <commons-net.version>3.6</commons-net.version>

        <project.scm.id>my-scm-server</project.scm.id>
        <maven.wagon.ssh.version>2.2</maven.wagon.ssh.version>
        <maven.release.plugin.version>2.5.3</maven.release.plugin.version>
        <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
        <maven.properties.plugin.version>1.0.0</maven.properties.plugin.version>
        <maven.remote.resources.plugin.version>1.5</maven.remote.resources.plugin.version>
        <maven.exec.plugin.version>1.6.0</maven.exec.plugin.version>
        <maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
        <maven.shade.plugin.version>3.1.1</maven.shade.plugin.version>
    </properties>
</project>
