<!-- ********************************************************* -->
<!-- **              Alfresco Parent POM                    ** -->
<!-- ********************************************************* -->
<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-parent</artifactId>
  <packaging>pom</packaging>
  <version>5.0.d</version>
  <name>Alfresco</name>

  <url>http://www.alfresco.org/</url>
  <inceptionYear>2005</inceptionYear>
  <organization>
    <name>Alfresco Software</name>
    <url>http://www.alfresco.org/</url>
  </organization>
  <licenses>
    <license>
      <name>${maven.license.name}</name>
      <url>${maven.license.url}</url>
    </license>
  </licenses>
  <scm>
    <connection>${maven.scm.connection}</connection>
    <developerConnection>${maven.scm.developerConnection}</developerConnection>
    <url>${maven.scm.url}</url>
  </scm>
  <issueManagement>
    <system>JIRA</system>
    <url>https://issues.alfresco.com/jira/browse/ALF</url>
  </issueManagement>
  <ciManagement>
    <system>Bamboo</system>
    <url>https://bamboo.alfresco.com/bamboo/browse/ALF</url>
  </ciManagement>

  <prerequisites>
    <maven>3.0.3</maven>
  </prerequisites>

  <repositories>
    <repository>
      <id>alfresco-public</id>
      <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>alfresco-public-snapshots</id>
      <url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <!-- Only used for the customised version of yuicompressor in yuicompressor-maven-plugin -->
      <id>alfresco-public</id>
      <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
    </pluginRepository>
  </pluginRepositories>

  <distributionManagement>
      <!-- For now internal releases repositories -->
      <repository>
          <id>alfresco-internal</id>
          <url>${maven.distributionManagement.url}</url>
      </repository>
      <!-- For now internal snapshot repositories -->
      <snapshotRepository>
          <id>alfresco-internal-snapshots</id>
          <url>${maven.distributionManagement.snapshot.url}</url>
      </snapshotRepository>      
  </distributionManagement>

  <modules>
    <module>projects/3rd-party</module>
    <module>projects/surf</module>
    <module>projects/core</module>
    <module>projects/data-model</module>
    <module>projects/legacy-lucene</module>
    <module>projects/alfresco-jlan</module>
    <module>projects/mbeans</module>
    <module>projects/repository</module>
    <module>projects/remote-api</module>
    <module>projects/web-framework-commons</module>
    <module>projects/web-client</module>
    <module>projects/slingshot</module>
    <module>projects/web-editor</module>
    <module>projects/web-editor-plugin</module>
    <module>projects/solr-client</module>
    <module>projects/solr4</module>
    <module>projects/solr</module>
    <module>projects/file-transfer-receiver</module>
    <module>projects/system-build-test</module>
    <module>modules/sharepoint/amp</module>
    <module>modules/wcmquickstart</module>
    <module>projects/web-editor-samples/customer-site</module>
    <module>projects/mmt</module>
    <module>projects/share-po</module>
    <module>projects/sdk/alfresco-platform-distribution</module>
  </modules>

  <properties>
    <tomcat.default.alfresco.port>8080</tomcat.default.alfresco.port>
    <tomcat.default.alfresco.ssl.port>8443</tomcat.default.alfresco.ssl.port>
    <tomcat.default.share.port>8081</tomcat.default.share.port>
    <tomcat.default.share.ssl.port>8444</tomcat.default.share.ssl.port>
    <tomcat.default.solr.port>8082</tomcat.default.solr.port>
    <tomcat.default.solr.ssl.port>8445</tomcat.default.solr.ssl.port>
    <tomcat.default.solr4.port>8083</tomcat.default.solr4.port>
    <tomcat.default.solr4.ssl.port>8446</tomcat.default.solr4.ssl.port>
    
    <!-- Database properties - default values to be overridden in settings.xml -->
    <db.skip>true</db.skip>
    <db.driver>org.postgresql.Driver</db.driver>
    <db.name>alfresco</db.name>
    <db.url>jdbc:postgresql:${db.name}</db.url>
    <db.master.url>jdbc:postgresql:template1</db.master.url>
    <db.username>alfresco</db.username>
    <db.password>alfresco</db.password>
    <db.master.username>alfresco</db.master.username>
    <db.master.password>alfresco</db.master.password>
    <db.drop.command>drop database if exists ${db.name}</db.drop.command>
    <db.create.command>create database ${db.name}</db.create.command>
    <test.working.dir>${project.build.directory}</test.working.dir>
    <dir.root>${test.working.dir}/alf_test_data</dir.root>
    <img.exe>convert</img.exe>
    <swf.exe>pdf2swf</swf.exe>
    <index.subsystem.name>buildonly</index.subsystem.name>

    <!-- Maven specific build properties -->
    <maven.build.sourceVersion>1.7</maven.build.sourceVersion>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <argLine>-Xmx2G -XX:MaxPermSize=256m -Duser.language=en -Dcom.sun.management.jmxremote</argLine>

    <!-- Community build specific properties -->
    <maven.scm.connection>scm:svn:http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD</maven.scm.connection>
    <maven.scm.developerConnection>scm:svn:https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD</maven.scm.developerConnection>
    <maven.scm.url>https://fisheye.alfresco.com/changelog/alfresco-enterprise</maven.scm.url>
    <maven.repository.url>https://artifacts.alfresco.com/nexus/content/groups/public</maven.repository.url>
    <maven.distributionManagement.snapshot.url>https://artifacts.alfresco.com/nexus/content/repositories/snapshots</maven.distributionManagement.snapshot.url>
    <maven.distributionManagement.url>https://artifacts.alfresco.com/nexus/content/repositories/internal-staging</maven.distributionManagement.url>
    <maven.license.name>GNU Lesser General Public License v3.0 or later</maven.license.name>
    <maven.license.url>http://www.gnu.org/licenses/lgpl-3.0-standalone.html</maven.license.url>

    <alfresco.googledocs.version>3.0.0</alfresco.googledocs.version>
    <!-- Default location of the root of the checkout. To be overrided if project is deeper than 2 levels -->
    <highest.basedir>${basedir}/../..</highest.basedir>

    <!-- Centralized dependency versions -->
    <dependency.lucene.version>2.4.1</dependency.lucene.version>
    <dependency.jibx.version>1.2.6</dependency.jibx.version>
    <dependency.tika.version>1.6-20140428-alfresco-patched</dependency.tika.version>
    <dependency.vorbisJava.version>0.4</dependency.vorbisJava.version>
    <dependency.opencmis.version>0.11.0</dependency.opencmis.version>
    <dependency.antlr.version>3.5.2</dependency.antlr.version>
    <dependency.spring.version>3.2.10.RELEASE</dependency.spring.version>
    <dependency.tomcat.version>7.0.59</dependency.tomcat.version>
    <dependency.activiti.version>5.16.4</dependency.activiti.version>
    <dependency.jackson2.version>2.3.2</dependency.jackson2.version>
    <dependency.poi.version>3.10.1</dependency.poi.version>
    <dependency.mysql.version>5.1.34</dependency.mysql.version>
    <dependency.postgresql.version>9.3-1102-jdbc41</dependency.postgresql.version>
    <dependency.yui.version>2.9.0-alfresco-20141223</dependency.yui.version>

    <!-- Versions of binaries packaged in the installer -->
    <installer.tomcat.version>${dependency.tomcat.version}-alfresco-distribution</installer.tomcat.version>
    <installer.java.version>1.8.0_31</installer.java.version>
    <installer.postgresql.version>9.3.6</installer.postgresql.version>
    <installer.libreoffice.version>4.2.5-alfresco</installer.libreoffice.version>
  </properties>
  
  <!-- Define versions of very common components -->
  <dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.7</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.7</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.8</version>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-xmlfactory</artifactId>
            <version>1.0.2</version>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.10.0-alfresco-patched</version>
        </dependency>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.7.2</version>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.1.6</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20090211</version>
        </dependency>
        <!-- Use patched FreeMarker to fix ALF-10188 -->
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.20-alfresco-patched</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.9.13</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.13</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.9.2</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.10</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <version>1.9</version>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4-DBCP330</version>
        </dependency>
        <dependency>
            <groupId>commons-discovery</groupId>
            <artifactId>commons-discovery</artifactId>
            <version>0.5</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1-HTTPCLIENT-1265</version>
        </dependency>
        <dependency>
            <groupId>commons-el</groupId>
            <artifactId>commons-el</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>commons-jxpath</groupId>
            <artifactId>commons-jxpath</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-modeler</groupId>
            <artifactId>commons-modeler</artifactId>
            <version>2.0.1</version>
        </dependency>
        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>3.3</version>
        </dependency>
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-api</artifactId>
            <version>1.2.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-impl</artifactId>
            <version>1.2.7</version>
        </dependency>
        <dependency>
            <groupId>org.tuckey</groupId>
            <artifactId>urlrewritefilter</artifactId>
            <version>4.0.4</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>2.2.6</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.2.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>1.1.8</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>1.1.8</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${dependency.postgresql.version}</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${dependency.mysql.version}</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.182</version>
        </dependency>
    </dependencies>
  </dependencyManagement>

  <build>                  
    <!-- Non standard folder layout -->
    <sourceDirectory>source/java</sourceDirectory>
    <testSourceDirectory>source/test-java</testSourceDirectory>
    <resources>
        <resource>
            <directory>config</directory>
        </resource>
    </resources>
    <testResources>
        <testResource>
             <directory>source/test-resources</directory> 
        </testResource>
    </testResources>

	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-enforcer-plugin</artifactId>
			<version>1.3.1</version>
			<executions>
				<execution>
					<id>enforcer</id>
					<goals>
						<goal>enforce</goal>
					</goals>
					<configuration>
						<rules>
							<requireJavaVersion>
								<version>1.7.0</version>
							</requireJavaVersion>
							<bannedDependencies>
                                <excludes>
                                    <exclude>xerces</exclude>
                                    <exclude>org.apache.xerces</exclude>
                                </excludes>
                                <includes>
                                    <include>xerces:xercesImpl:2.10.0-alfresco-patched</include>
                                </includes>
							</bannedDependencies>
						</rules>
					</configuration>
				</execution>
			</executions>
		</plugin>

		<!-- Create a jar of test classes, to be reused later in remote-api -->
		<plugin>
			<artifactId>maven-jar-plugin</artifactId>
			<executions>
				<execution>
					<id>create-test-jar</id>
					<goals>
						<goal>test-jar</goal>
					</goals>
				</execution>
			</executions>
		</plugin>

        <!-- If version.properties can be found, read it to set version properties for manifest -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <executions>
                <execution>
                    <id>read-version-properties</id>
                    <phase>initialize</phase>
                    <goals>
                        <goal>read-project-properties</goal>
                    </goals>
                    <configuration>
                        <files>
                            <file>${highest.basedir}/projects/repository/config/alfresco/version.properties</file>
                        </files>
                        <quiet>true</quiet>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>

    <!-- Defining version and some configuration of Maven plugins -->
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>${maven.build.sourceVersion}</source>
                    <target>${maven.build.sourceVersion}</target>
                </configuration>        
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
            <plugin>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <includeEmptyDirs>true</includeEmptyDirs>
                </configuration>        
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.4</version>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.3</version>
                <!-- MASSEMBLY-747 - remove when 2.5.4 is released -->
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-io</artifactId>
                        <version>2.5</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
            </plugin>
            <plugin>
                <artifactId>maven-help-plugin</artifactId>
                <version>2.2</version>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagBase>https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/TAGS/CLOUD</tagBase>
                    <tagNameFormat>V@{project.version}</tagNameFormat>
                    <stagingRepository>alfresco-internal::default::https://artifacts.alfresco.com/nexus/content/repositories/internal-staging/</stagingRepository>
                </configuration>        
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <!-- To prevent tests alfresco.log to be created in project roots and bother while synchronizing with SCM -->
                    <workingDirectory>${project.build.directory}</workingDirectory>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <runOrder>alphabetical</runOrder>
                    <systemPropertyVariables>
                        <!-- Modified BaseTest and AVMServiceTestBase to accept these properties
                         Otherwise test were looking in hardcoded relative locations -->
                        <alfresco.test.resources.dir>${basedir}/source/test-resources</alfresco.test.resources.dir>
                        <alfresco.web.resources.dir>${basedir}/source/web</alfresco.web.resources.dir>
                        <alfresco.java.sources.dir>${basedir}/source/java</alfresco.java.sources.dir>
                        <alfresco.target.dir>${project.build.directory}</alfresco.target.dir>
                        <!-- Allow FTP server unit test to run unprivileged -->
                        <ftp.port>50521</ftp.port>
                        <!-- ACE-2704 turned off the ftp and transfer service receiver which must be enabled for integration test -->
                        <ftp.enabled>true</ftp.enabled>
                        <transferservice.receiver.enabled>true</transferservice.receiver.enabled>
                        <!-- Database related properties -->
                        <db.url>${db.url}</db.url>
                        <db.driver>${db.driver}</db.driver>
                        <db.name>${db.name}</db.name>
                        <db.username>${db.username}</db.username>
                        <db.password>${db.password}</db.password>
                        <dir.root>${dir.root}</dir.root>
                        <img.exe>${img.exe}</img.exe>
                        <swf.exe>${swf.exe}</swf.exe>
                        <!-- BDE-91 -->
                        <alfresco.rmi.services.retries>30</alfresco.rmi.services.retries>
                        <alfresco.rmi.services.retryInterval>2000</alfresco.rmi.services.retryInterval>
                        <!-- Enables Lucene in continuous integration -->
                        <index.subsystem.name>${index.subsystem.name}</index.subsystem.name>
                    </systemPropertyVariables>
                    <enableAssertions>false</enableAssertions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.1</version>
                <configuration>
                    <javadocDirectory>source/javadoc</javadocDirectory>
                    <excludePackageNames>org.customer,org.apache</excludePackageNames>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
            </plugin>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.3</version>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <skipIfEmpty>true</skipIfEmpty>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Specification-Version>${version.major}.${version.minor}.${version.revision}</Specification-Version>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Build-Date>${maven.build.timestamp}</Build-Date>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Specification-Version>${version.major}.${version.minor}.${version.revision}</Specification-Version>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Build-Date>${maven.build.timestamp}</Build-Date>
                        </manifestEntries>
                    </archive>
                    <warSourceDirectory>source/web</warSourceDirectory>
                    <attachClasses>true</attachClasses>
                    <useCache>true</useCache>
                    <recompressZippedFiles>false</recompressZippedFiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>8.1.16.v20140903</version>
                <configuration>
                    <webAppSourceDirectory>source/web</webAppSourceDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.2.v20140723</version>
                <configuration>
                    <webAppSourceDirectory>source/web</webAppSourceDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jibx</groupId>
                <artifactId>maven-jibx-plugin</artifactId>
                <version>${dependency.jibx.version}</version>
                <!-- ACE-3667: Workaround for JIBX-515 -->
                <dependencies>
                    <dependency>
                        <groupId>org.jibx</groupId>
                        <artifactId>jibx-bind</artifactId>
                        <version>${dependency.jibx.version}</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>bcel</artifactId>
                                <groupId>bcel</groupId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.bcel</groupId>
                        <artifactId>bcel</artifactId>
                        <version>6.0-RC3</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.alfresco.maven.plugin</groupId>
                <artifactId>alfresco-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-archiver</artifactId>
                        <version>2.9.1</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <systemProperties>
                        <db.url>${db.url}</db.url>
                        <db.driver>${db.driver}</db.driver>
                        <db.name>${db.name}</db.name>
                        <db.username>${db.username}</db.username>
                        <db.password>${db.password}</db.password>
                        <dir.root>${dir.root}</dir.root>
                    </systemProperties>
                    <keystoreFile>${highest.basedir}/projects/system-build-test/keystore/ssl.keystore</keystoreFile>
                    <keystorePass>kT9X6oe68t</keystorePass>
                    <keystoreType>JCEKS</keystoreType>
                    <truststoreFile>${highest.basedir}/projects/system-build-test/keystore/ssl.truststore</truststoreFile>
                    <truststorePass>kT9X6oe68t</truststorePass>
                    <truststoreType>JCEKS</truststoreType>
                    <tomcatUsers>${highest.basedir}/packaging/installer/src/main/resources/bitrock/bitrock/alfresco/shared/tomcat-users.xml</tomcatUsers>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr3-maven-plugin</artifactId>
                <version>${dependency.antlr.version}</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sql-maven-plugin</artifactId>
                <version>1.5</version>
                <configuration>
                    <skip>${db.skip}</skip>
                    <autocommit>true</autocommit>
                    <driver>${db.driver}</driver>
                    <url>${db.master.url}</url>
                    <username>${db.master.username}</username>
                    <password>${db.master.password}</password>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.postgresql</groupId>
                        <artifactId>postgresql</artifactId>
                        <version>${dependency.postgresql.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>${dependency.mysql.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.3.2</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>rpm-maven-plugin</artifactId>
                <version>2.1.2</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.1</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9.1</version>
            </plugin>
            <plugin>
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>replacer</artifactId>
                <version>1.5.3</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.2.201409121644</version>
            </plugin>
			<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
			<plugin>
				<groupId>org.eclipse.m2e</groupId>
				<artifactId>lifecycle-mapping</artifactId>
				<version>1.0.0</version>
				<configuration>
					<lifecycleMappingMetadata>
						<pluginExecutions>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.codehaus.mojo</groupId>
									<artifactId>
										sql-maven-plugin
									</artifactId>
									<versionRange>[1.5,)</versionRange>
									<goals>
										<goal>execute</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.apache.maven.plugins</groupId>
									<artifactId>maven-dependency-plugin</artifactId>
									<versionRange>[2.7,)</versionRange>
									<goals>
										<goal>unpack</goal>
       									<goal>copy</goal>
										<goal>copy-dependencies</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.apache.maven.plugins</groupId>
									<artifactId>maven-enforcer-plugin</artifactId>
									<versionRange>[1.3.0,)</versionRange>
									<goals>
										<goal>enforce</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.codehaus.mojo</groupId>
									<artifactId>properties-maven-plugin</artifactId>
									<versionRange>[1.0-alpha-2,)</versionRange>
									<goals>
										<goal>read-project-properties</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore/>
								</action>
							</pluginExecution>
        					<pluginExecution>
        						<pluginExecutionFilter>
        							<groupId>org.apache.maven.plugins</groupId>
        							<artifactId>maven-antrun-plugin</artifactId>
        							<versionRange>[1.7,)</versionRange>
        							<goals>
        								<goal>run</goal>
        							</goals>
        						</pluginExecutionFilter>
        						<action>
        							<ignore/>
        						</action>
        					</pluginExecution>
       						<pluginExecution>
       							<pluginExecutionFilter>
       								<groupId>org.alfresco.maven.plugin</groupId>
       								<artifactId>alfresco-maven-plugin</artifactId>
       								<versionRange>[0,)</versionRange>
       								<goals>
       									<goal>set-version</goal>
       								</goals>
       							</pluginExecutionFilter>
       							<action>
       								<ignore/>
       							</action>
       						</pluginExecution>
						</pluginExecutions>
					</lifecycleMappingMetadata>
				</configuration>
			</plugin>
        </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <plugins>
        <plugin>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.4</version>
        </plugin>
        <plugin>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.8</version>
            <configuration>
                <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
            </configuration>
            <reportSets>
              <reportSet>
                <reports>
                  <report>index</report>
                  <report>summary</report>
                  <report>dependencies</report>
                  <report>dependency-convergence</report>
                  <report>dependency-management</report>
                  <report>license</report>
                  <report>modules</report>
                </reports>
              </reportSet>
            </reportSets>
        </plugin>
        <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.18.1</version>
        </plugin>
        <plugin>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <targetJdk>${maven.build.sourceVersion}</targetJdk>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <aggregate>false</aggregate>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.0</version>
        </plugin>
    </plugins>
  </reporting>

  <profiles>
    <!-- Profile to build Community packaging, including installers -->
    <profile>
        <id>packaging</id>
        <modules>
            <module>packaging</module>
        </modules>
    </profile>

    <!-- Profile to add all sub-projects - handy to change the version -->
    <profile>
        <id>allprojects</id>
        <modules>
            <module>packaging</module>
            <module>projects/qa-share</module>
            <module>projects/share</module>
        </modules>

        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>2.0-1588784</version>
                    <executions>
                        <execution>
                            <id>default-cli</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <reactorModuleConvergence />
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

	<!-- Database profiles, if not using PostgreSQL -->
	<profile>
		<id>mysql</id>
		<properties>
			<db.master.url>jdbc:mysql://localhost/</db.master.url>
		    <db.driver>com.mysql.jdbc.Driver</db.driver>
    		<db.url>jdbc:mysql://localhost/${db.name}</db.url>
    	</properties>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.tomcat.maven</groupId>
					<artifactId>tomcat7-maven-plugin</artifactId>
					<configuration>
						<systemProperties>
							<db.driver>com.mysql.jdbc.Driver</db.driver>
							<db.url>${db.master.url}</db.url>
						</systemProperties>
					</configuration>
					<dependencies>
			            <dependency>
			                <groupId>mysql</groupId>
			                <artifactId>mysql-connector-java</artifactId>
                         <version>${dependency.mysql.version}</version>
			            </dependency>
					</dependencies>
				</plugin>
			</plugins>
		</build>
		<dependencies>
			<dependency>
				<groupId>mysql</groupId>
				<artifactId>mysql-connector-java</artifactId>
			</dependency>
		</dependencies>
	</profile>

    <profile>
        <id>mariadb</id>
        <properties>
            <db.master.url>jdbc:mysql://localhost/</db.master.url>
            <db.driver>org.gjt.mm.mysql.Driver</db.driver>
            <db.url>jdbc:mysql://localhost/${db.name}</db.url>
        </properties>
        <dependencies>
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
            </dependency>
        </dependencies>
    </profile>

    <profile>
        <id>oracle</id>
        <properties>
            <db.driver>oracle.jdbc.OracleDriver</db.driver>
            <db.url>jdbc:oracle:thin:@${db.host}:1521/${db.host}</db.url>
            <db.master.url>${db.url}</db.master.url>
            <db.drop.command>drop user ${db.username} cascade;</db.drop.command>
            <db.create.command>grant connect,resource to ${db.username} identified by ${db.password};</db.create.command>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <configuration>
                        <systemProperties>
                            <db.driver>${db.driver}</db.driver>
                            <db.url>${db.url}</db.url>
                        </systemProperties>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.oracle.ojdbc6</groupId>
                            <artifactId>ojdbc6</artifactId>
                            <version>11.2.0.1.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sql-maven-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>com.oracle.ojdbc6</groupId>
                            <artifactId>ojdbc6</artifactId>
                            <version>11.2.0.1.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
        <dependencies>
            <dependency>
                <groupId>com.oracle.ojdbc6</groupId>
                <artifactId>ojdbc6</artifactId>
                <version>11.2.0.1.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>

    <profile>
        <id>sqlserver</id>
        <properties>
            <db.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</db.driver>
            <db.url>jdbc:sqlserver://${db.host};databaseName=${db.name};</db.url>
            <db.master.url>jdbc:sqlserver://${db.host};databaseName=master</db.master.url>
            <db.master.username>${db.username}</db.master.username>
            <db.master.password>${db.password}</db.master.password>
            <db.drop.command>drop database ${db.name};</db.drop.command>
            <db.create.command>CREATE DATABASE ${db.name}; ALTER DATABASE ${db.name} SET ALLOW_SNAPSHOT_ISOLATION ON;</db.create.command>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sql-maven-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>com.microsoft.sqlserver</groupId>
                            <artifactId>sqljdbc</artifactId>
                            <version>4.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <!-- MNT-13089 SQLServer needs the transaction isolation parameter increased -->
                        <systemPropertyVariables>
                            <db.txn.isolation>4096</db.txn.isolation>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </build>
        <dependencies>
            <dependency>
                <groupId>com.microsoft.sqlserver</groupId>
                <artifactId>sqljdbc</artifactId>
                <version>4.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>

    <profile>
        <id>db2</id>
        <properties>
            <db.driver>com.ibm.db2.jcc.DB2Driver</db.driver>
            <db.url>jdbc:db2://${db.host}:50000/${db.name}</db.url>
            <db.username>db2admin</db.username>
            <!-- No master URL for DB2: it's not possible to drop a database through an SQL command -->
        </properties>
        <dependencies>
            <dependency>
                <groupId>com.ibm.db2.jcc</groupId>
                <artifactId>db2jcc4</artifactId>
                <version>4.12.55</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>

    <profile>
        <id>h2</id>
        <properties>
            <db.params>MODE=PostgreSQL;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=TRUE</db.params>
            <db.master.url>jdbc:h2:${test.working.dir}/h2_data/${db.name};${db.params}</db.master.url>
            <db.driver>org.h2.jdbcx.JdbcDataSource</db.driver>
            <db.url>${db.master.url}</db.url>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <configuration>
                        <systemProperties>
                            <db.driver>org.h2.jdbcx.JdbcDataSource</db.driver>
                            <db.url>${db.master.url}</db.url>
                        </systemProperties>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>tk.skuro.alfresco</groupId>
                            <artifactId>h2-support</artifactId>
                            <version>1.6</version>
                        </dependency>
                        <dependency>
                            <groupId>com.h2database</groupId>
                            <artifactId>h2</artifactId>
                            <version>1.4.182</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
        <dependencies>
            <dependency>
                <groupId>tk.skuro.alfresco</groupId>
                <artifactId>h2-support</artifactId>
                <version>1.6</version>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
            </dependency>
        </dependencies>
    </profile>

    <!-- Generate the Javadoc for Public API only (filtered on AlfrescoPublicApi annotation) -->
    <profile>
        <id>publicapi</id>
        <properties>
            <docflex.version>1.6.1</docflex.version>
        </properties>
        <!-- Downloads the docflex license -->
        <dependencies>
            <dependency>
                <groupId>com.docflex</groupId>
                <artifactId>docflex-alfresco-license</artifactId>
                <version>1.0</version>
                <type>license</type>
            </dependency>
        </dependencies>
        <!-- Extracts Docflex locally -->
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <!-- Unzips the docflex/javadoc doclet -->
                        <execution>
                            <id>default-cli</id>
                            <inherited>false</inherited>
                            <goals>
                                <goal>unpack</goal>
                            </goals>
                            <configuration>
                                <artifactItems>
                                    <artifactItem>
                                        <groupId>com.docflex</groupId>
                                        <artifactId>docflex-javadoc</artifactId>
                                        <version>${docflex.version}</version>
                                        <type>zip</type>
                                    </artifactItem>
                                </artifactItems>
                                <outputDirectory>${project.build.directory}</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <doclet>com.docflex.javadoc.Doclet</doclet>
                        <docletPath>${project.build.directory}/docflex-javadoc-${docflex.version}/lib/docflex-javadoc.jar</docletPath>
                        <additionalparam>
                            -license ${settings.localRepository}/com/docflex/docflex-alfresco-license/1.0/docflex-alfresco-license-1.0.license
                            -template ${project.build.directory}/docflex-javadoc-${docflex.version}/templates/JavadocPro/FramedDoc.tpl
                            -nodialog
                            -launchviewer=false
                            -p:filter.byAnns.include.classes=org.alfresco.api.AlfrescoPublicApi
                            -p:docTitle "Alfresco ${project.version} Public API"
                            -p:windowTitle "Alfresco ${project.version} Public API"
                        </additionalparam>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

	<profile>
		<id>solr-http</id>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.tomcat.maven</groupId>
					<artifactId>tomcat7-maven-plugin</artifactId>
					<configuration>
						<systemProperties>
							<index.subsystem.name>solr</index.subsystem.name>
							<solr.host>localhost</solr.host>
							<solr.port>${tomcat.default.solr.port}</solr.port>
							<solr.secureComms>none</solr.secureComms>
							<solr.backup.alfresco.numberToKeep>0</solr.backup.alfresco.numberToKeep>
                            <solr.backup.archive.numberToKeep>0</solr.backup.archive.numberToKeep>
						</systemProperties>
					</configuration>
				</plugin>
			</plugins>
		</build>
	</profile>
	  <profile>
        <id>solr4-ssl</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <configuration>
                        <systemProperties>
                            <index.subsystem.name>solr4</index.subsystem.name>
                            <solr.host>localhost</solr.host>
                            <solr.port>${tomcat.default.solr4.ssl.port}</solr.port>
                            <solr.secureComms>https</solr.secureComms>
                            <solr.backup.alfresco.numberToKeep>0</solr.backup.alfresco.numberToKeep>
                            <solr.backup.archive.numberToKeep>0</solr.backup.archive.numberToKeep>
                        </systemProperties>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
  </profiles>
</project>
