<?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.aos-module</groupId>
    <artifactId>alfresco-aos-module</artifactId>
    <version>1.1.4</version>
    <name>Alfresco Office Services Module</name>
    <packaging>amp</packaging>
    <description>Allows applications that can talk to a SharePoint server to talk to your Alfresco installation</description>

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

    <url>http://www.alfresco.org/</url>
    <inceptionYear>2015</inceptionYear>

    <organization>
        <name>Alfresco Software</name>
        <url>http://www.alfresco.org/</url>
    </organization>

    <licenses>
        <license>
            <name>Alfresco Component License Agreement</name>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>skopf</id>
            <name>Stefan Kopf</name>
            <email>stefan.kopf@alfresco.com</email>
            <url>http://alfresco.org</url>
            <organization>Alfresco Software</organization>
            <organizationUrl>http://alfresco.org</organizationUrl>
            <roles>
                <role>Founder</role>
                <role>Architect</role>
                <role>Developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <contributors>
        <contributor />
    </contributors>

    <properties>
        <alfresco.version>5.1</alfresco.version>
        <app.log.root.level>WARN</app.log.root.level>
        <env>local</env>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.source>1.7</maven.compiler.source>
    </properties>

    <distributionManagement>
        <repository>
            <id>alfresco-internal</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/internal-releases</url>
        </repository>
        <snapshotRepository>
            <id>alfresco-internal-snapshots</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/internal-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${alfresco.groupId}</groupId>
                <artifactId>alfresco-platform-distribution</artifactId>
                <version>${alfresco.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>alfresco-aos-repo-binding</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-repository</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-remote-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-repository</artifactId>
            <version>${alfresco.version}</version>
            <classifier>h2scripts</classifier>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>alfresco-internal</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
        </repository>
        <repository>
            <id>alfresco-private</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
        </repository>
    </repositories>
    
    <pluginRepositories>
        <pluginRepository>
            <id>alfresco-internal</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
        </pluginRepository>
        <pluginRepository>
            <id>alfresco-private</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.alfresco</groupId>
                        <artifactId>alfresco-repository</artifactId>
                        <version>${alfresco.version}</version>
                        <classifier>h2scripts</classifier>
                        <exclusions>
                            <exclusion>
                                <groupId>*</groupId>
                                <artifactId>*</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <profile>
            <id>alfresco-rad</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <plugins>
                    <!-- Fetch and unpack Alfresco Repository WAR (alfresco.war) -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-alfresco</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${app.amp.client.war.folder}</outputDirectory>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>${alfresco.groupId}</groupId>
                                            <artifactId>${app.amp.client.war.artifactId}</artifactId>
                                            <type>war</type>
                                            <version>${alfresco.version}</version>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- The current AMP artifact is installed into the Alfresco folder using alfresco-maven-plugin -->
                    <plugin>
                        <groupId>org.alfresco.maven.plugin</groupId>
                        <artifactId>alfresco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>amps-to-war-overlay</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>install</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- We need to selectively not install web resources so to enable rapid dev -->
                            <includeWebResources>false</includeWebResources>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat7-maven-plugin</artifactId>
                        <configuration>
                            <ajpPort>8009</ajpPort>
                            <uriEncoding>UTF-8</uriEncoding>
                            <useTestClasspath>false</useTestClasspath>
                            <ignorePackaging>true</ignorePackaging>
                            <useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
                            <systemProperties>
                                <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
                            </systemProperties>
                            <delegate>true</delegate>
                            <contextFile>${project.basedir}/tomcat/context.xml</contextFile>
                            <webapps>
                                <webapp>
                                    <groupId>${alfresco.groupId}</groupId>
                                    <artifactId>alfresco-server-root</artifactId>
                                    <version>${alfresco.version}</version>
                                    <type>war</type>
                                    <asWebapp>true</asWebapp>
                                    <contextPath>/</contextPath>
                                    <!-- Workaround for https://issues.apache.org/jira/browse/MTOMCAT-269 -->
                                    <!-- tomcat7-maven-plugin does not pick up the context.xml file from META-INF -->
                                    <contextFile>${project.build.directory}/tomcat/webapps/alfresco-server-root/META-INF/context.xml</contextFile>
                                </webapp>
                                <webapp>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>alfresco-vti-bin</artifactId>
                                    <version>${project.version}</version>
                                    <type>war</type>
                                    <asWebapp>true</asWebapp>
                                    <contextPath>/_vti_bin</contextPath>
                                </webapp>
                                <webapp>
                                    <groupId>${alfresco.groupId}</groupId>
                                    <artifactId>share</artifactId>
                                    <version>${alfresco.version}</version>
                                    <type>war</type>
                                    <asWebapp>true</asWebapp>
                                    <contextPath>/share</contextPath>
                                </webapp>
                            </webapps>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>alfresco-vti-bin</artifactId>
                    <version>${project.version}</version>
                    <type>war</type>
                </dependency>
                <dependency>
                    <groupId>org.alfresco.maven</groupId>
                    <artifactId>alfresco-rad</artifactId>
                    <version>${maven.alfresco.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>enterprise</id>
            <dependencies>
                <dependency>
                    <groupId>${alfresco.groupId}</groupId>
                    <artifactId>alfresco-enterprise-repository</artifactId>
                    <version>${alfresco.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>

    </profiles>

  <scm>
    <tag>alfresco-aos-module-aggregator-1.1.4</tag>
  </scm>
</project>
