<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>content-services-community</artifactId>
    <name>Alfresco Content Services Community WAR</name>
    <packaging>war</packaging>

    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>acs-community-packaging</artifactId>
        <version>6.0.5-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <scm-path>local/development/workspace</scm-path>
        <scm-revision>${buildNumber}</scm-revision>

        <licenseName>community</licenseName>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-repository</artifactId>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-remote-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-trashcan-cleaner</artifactId>
        </dependency>
        <dependency>
            <groupId>org.alfresco.services</groupId>
            <artifactId>alfresco-messaging-repo</artifactId>
        </dependency>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-jxpath</groupId>
            <artifactId>commons-jxpath</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.avalon.framework</groupId>
            <artifactId>avalon-framework-api</artifactId>
            <version>4.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.avalon.framework</groupId>
            <artifactId>avalon-framework-impl</artifactId>
            <version>4.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.bcel</groupId>
            <artifactId>bcel</artifactId>
            <version>6.0-RC3</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>
        <!-- 'provided' dependencies, not packaged in war -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.portlet</groupId>
            <artifactId>portlet-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <!-- CORS Filter Libraries -->
        <dependency>
            <groupId>com.thetransactioncompany</groupId>
            <artifactId>cors-filter</artifactId>
            <version>2.5</version>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-core</artifactId>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-repository</artifactId>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-remote-api</artifactId>
            <classifier>tests</classifier>
            <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.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.shale</groupId>
            <artifactId>shale-test</artifactId>
            <version>1.0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${dependency.postgresql.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${dependency.mysql.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>alfresco</finalName>
        <resources>
            <!-- Allow replacing variables inside version.properties -->
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>alfresco/version.properties</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>alfresco/version.properties</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <!-- Creates a scm revision and stores in ${buildNumber} variable -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <shortRevisionLength>8</shortRevisionLength>
                </configuration>
            </plugin>
            <!-- populate version.properties with the correct version -->
            <!-- Creates the following variables:
                 parsedVersion.majorVersion
                 parsedVersion.minorVersion
                 parsedVersion.incrementalVersion
             -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- CLOUD-1967 Put core log4j config in WEB-INF/classes, so that it's first in classloader -->
                    <execution>
                        <id>fetch-log4j-config</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-core</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <includes>log*.properties</includes>
                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <!-- This allows overlays to be prepared on the FS for minification and faster run -->
                <executions>
                    <execution>
                        <id>pre-exploded-war</id>
                        <goals>
                            <goal>exploded</goal>
                        </goals>
                        <phase>prepare-package</phase>
                    </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>
    </build>

    <profiles>
        <!-- Tweaks required to make the build work in Eclipse -->
        <profile>
            <id>m2e</id>
            <dependencies>
                <dependency>
                   <groupId>commons-logging</groupId>
                   <artifactId>commons-logging</artifactId>
                   <!-- This is needed for Maven tomcat run -->
                   <scope>runtime</scope>
                </dependency>
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                </dependency>
            </dependencies>
       </profile>
    </profiles>
</project>
