<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>alfresco-file-transfer-receiver</artifactId>
    <name>Alfresco File Transfer Receiver</name>
    <packaging>war</packaging>

    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-ftr-parent</artifactId>
        <version>6.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <!-- Skip tests: they are not run in the Ant build, and they all fail... -->
        <skipTests>true</skipTests>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-remote-api</artifactId>
            <version>${dependency.alfresco-remote-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <version>10.12.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbytools</artifactId>
            <version>10.12.1.1</version>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${dependency.spring.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-repository</artifactId>
            <version>${dependency.alfresco-repository.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Fetch version.properties in alfresco-repository -->
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>fetch-version-properties</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-repository</artifactId>
                                    <version>${dependency.alfresco-repository.version}</version>
                                </artifactItem>
                            </artifactItems>
                            <includes>alfresco/version.properties</includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                    <organizationName>Alfresco Software Limited</organizationName>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                    <licenseResolver>classpath://alfresco</licenseResolver>
                    <licenseName>${licenseName}</licenseName>
                    <roots>
                        <root>src</root>
                    </roots>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.jsp</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <id>check-licenses</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>check-file-header</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.alfresco</groupId>
                        <artifactId>alfresco-license-headers</artifactId>
                        <version>1.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>1.13</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <!-- Additional resource folder where version.properties was extracted -->
            <resource>
                <directory>${project.build.directory}/dependency/alfresco</directory>
            </resource>
        </resources>
    </build>

</project>
