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

<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.alfresco</groupId>
    <artifactId>alfresco-xmlfactorypatch</artifactId>
    <version>1.0</version>
    <packaging>amp</packaging>
    <name>Alfresco XML Factory Patch AMP</name>
    <description>A module that can be applied to patch secure XML parser factories into the Alfresco repo</description>

    <parent>
        <groupId>org.alfresco.maven</groupId>
        <artifactId>alfresco-sdk-parent</artifactId>
        <version>1.1.1</version>
    </parent>

    <properties>
        <alfresco.groupId>org.alfresco</alfresco.groupId>
        <alfresco.version>4.2.e</alfresco.version>
        <alfrescoRepoVersionMin>2.2.0</alfrescoRepoVersionMin>
        <alfrescoRepoVersionMax>4.3.0</alfrescoRepoVersionMax>
        <spring.version>3.0.5.RELEASE</spring.version>
        <maven.compile.source>1.5</maven.compile.source>
        <maven.compile.target>1.5</maven.compile.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <war.file>${war.file.repo}</war.file>
        <war.artifactId>${war.artifactId.repo}</war.artifactId>
    </properties>

    <repositories>
        <repository>
            <id>alfresco-public-snapshots</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-xmlfactory</artifactId>
            <version>1.0.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>copy-local-lib</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/${project.build.finalName}/lib</outputDirectory>
                            <resources>          
                                 <resource>
                                     <directory>lib</directory>
                                 </resource>
                            </resources>              
                        </configuration>            
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.alfresco.maven.plugin</groupId>
                    <artifactId>alfresco-maven-plugin</artifactId>
                    <version>1.1.1</version>
                    <extensions>true</extensions>
                    <configuration>
                        <snapshotToTimestamp>true</snapshotToTimestamp>
                        <verbose>true</verbose>
                        <skipWarManifestCheck>true</skipWarManifestCheck>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>apply-repo-amps</id>
            <activation>
                <property><name>applyAmps</name></property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.alfresco.maven.plugin</groupId>
                        <artifactId>alfresco-maven-plugin</artifactId>
                    </plugin>
                </plugins>
             </build>
        </profile>
        <profile>
            <id>wars-from-maven</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                    </plugin>
                </plugins>
             </build>
        </profile>
    </profiles>

</project>
