<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>
    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-packaging</artifactId>
        <version>5.0.b</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>alfresco-distribution</artifactId>
    <packaging>jar</packaging>
    <name>Alfresco Distribution (WAR Installation)</name>

    <!-- To replace in share-config-custom.xml -->
    <properties>
        <BITROCK_TOMCAT_PORT>8080</BITROCK_TOMCAT_PORT>
    </properties>

    <dependencies>
        <!-- WAR files -->
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>${alfresco.war.artifactId}</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>${share.war.artifactId}</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-solr</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-solr4</artifactId>
            <version>${project.version}</version>
            <classifier>ssl</classifier>
            <type>war</type>
            <exclusions>
                <exclusion>
                    <groupId>jdk.tools</groupId>
                    <artifactId>jdk.tools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Solr config -->
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-solr</artifactId>
            <version>${project.version}</version>
            <classifier>config</classifier>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-solr4</artifactId>
            <version>${project.version}</version>
            <classifier>config-ssl</classifier>
            <type>zip</type>
            <exclusions>
                <exclusion>
                    <groupId>jdk.tools</groupId>
                    <artifactId>jdk.tools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-mmt</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- JAR files, to extract alfresco/extension -->
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-repository</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-data-model</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco</artifactId>
            <version>${project.version}</version>
            <classifier>classes</classifier>
        </dependency>

        <!-- 3rd party libs -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>
    </dependencies>

    <build>
        <finalName>${alfresco.package.name}-${project.version}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <delimiters>
                        <delimiter>${*}</delimiter>
                        <delimiter>@@</delimiter> <!-- To replace Tomcat port in share-config-custom.xml -->
                    </delimiters>
                    <useDefaultDelimiters>false</useDefaultDelimiters>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/assembly/distribution.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- profiles to only depend on alfresco-spp when building Community: it is not built in Enterprise, and fails the build -->
        <profile>
            <id>community</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.alfresco</groupId>
                    <artifactId>alfresco-spp</artifactId>
                    <version>${project.version}</version>
                    <type>amp</type>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>enterprise</id>
        </profile>
    </profiles>

</project>
