<!-- ****************************************************** -->
<!-- ** Experimental Maven build - use at your own risk! ** -->
<!-- ****************************************************** -->

<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>
    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-parent</artifactId>
        <version>4.2.c</version>
        <relativePath>../../pom-experimental.xml</relativePath>
    </parent>

    <!-- TODO: This build does not work yet because classes are missing from 
        the 1.0.0 Surf Jar -->
    <artifactId>share</artifactId>
    <packaging>war</packaging>
    <name>Alfresco Share</name>
    <description>Alfresco Share</description>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>alfresco-web-framework-commons</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                   <groupId>javax.servlet</groupId>
                   <artifactId>jsp-api</artifactId>
               </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>alfresco-jlan-embed</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>aopalliance</groupId>
                    <artifactId>aopalliance</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.mybatis</groupId>
                    <artifactId>mybatis</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.mybatis</groupId>
                    <artifactId>mybatis-spring</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.quartz-scheduler</groupId>
                    <artifactId>quartz</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.portlet</groupId>
            <artifactId>portlet-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.alfresco.cmis.client</groupId>
            <artifactId>alfresco-opencmis-extension</artifactId>
            <version>0.3</version>
            <exclusions>
                <exclusion>
                    <artifactId>jaxb-api</artifactId>
                    <groupId>javax.xml.bind</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>junit</artifactId>
                    <groupId>junit</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org.osgi.core</artifactId>
                    <groupId>org.apache.felix</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>saaj-impl</artifactId>
                    <groupId>com.sun.xml.messaging.saaj</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>stax-api</artifactId>
                    <groupId>javax.xml.stream</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>wstx-asl</artifactId>
                    <groupId>org.codehaus.woodstox</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.extensions.surf</groupId>
            <artifactId>spring-surf-api</artifactId>
            <version>${dependency.surf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.abdera</groupId>
            <artifactId>abdera-client</artifactId>
            <version>0.4.0-incubating</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>geronimo-stax-api_1.0_spec</artifactId>
                    <groupId>org.apache.geronimo.specs</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>geronimo-activation_1.0.2_spec</artifactId>
                    <groupId>org.apache.geronimo.specs</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>wstx-asl</artifactId>
                    <groupId>org.codehaus.woodstox</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xml-apis</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.extensions.surf</groupId>
            <artifactId>spring-cmis-framework</artifactId>
            <version>${dependency.surf.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>abdera-extensions-main</artifactId>
                    <groupId>org.apache.abdera</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>abdera-extensions-html</artifactId>
                    <groupId>org.apache.abdera</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>abdera-server</artifactId>
                    <groupId>org.apache.abdera</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-lang</artifactId>
                    <groupId>commons-lang</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>freemarker</artifactId>
                    <groupId>org.freemarker</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>geronimo-stax-api_1.0_spec</artifactId>
                    <groupId>org.apache.geronimo.specs</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>geronimo-activation_1.0.2_spec</artifactId>
                    <groupId>org.apache.geronimo.specs</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>js</artifactId>
                    <groupId>rhino</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jstl</artifactId>
                    <groupId>javax.servlet</groupId>
                </exclusion>
                <exclusion>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-digester</artifactId>
                    <groupId>commons-digester</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <artifactId>json-simple</artifactId>
            <groupId>com.googlecode.json-simple</groupId>
            <version>1.1.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>junit</artifactId>
                    <groupId>junit</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.tuckey</groupId>
            <artifactId>urlrewritefilter</artifactId>
            <version>3.1.0</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.2.2</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.1.3</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <artifactId>maven-cobertura-plugin</artifactId>
                    <groupId>maven-plugins</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>maven-findbugs-plugin</artifactId>
                    <groupId>maven-plugins</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>icu4j</artifactId>
                    <groupId>com.ibm.icu</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jdom</artifactId>
                    <groupId>jdom</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xom</artifactId>
                    <groupId>xom</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xercesImpl</artifactId>
                    <groupId>xerces</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xml-apis</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.18-alfresco-patched</version>
        </dependency>
        <!-- Dependency on the web-framework-commons resources skinny war -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>alfresco-web-framework-commons</artifactId>
            <version>${project.version}</version>
            <classifier>webapp</classifier>
            <type>war</type>
            <scope>provided</scope> <!-- ALF-16947 -->
        </dependency>
        <dependency>
            <artifactId>stax-api</artifactId>
            <groupId>stax</groupId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.facebook.api</groupId>
            <artifactId>facebook-java-api</artifactId>
            <version>070716</version>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast-spring</artifactId>
            <version>1.9.4.6</version>
            <exclusions>
                <exclusion>
                    <artifactId>hazelcast-client</artifactId>
                    <groupId>com.hazelcast</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jsr250-api</artifactId>
                    <groupId>javax.annotation</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>1.1.8</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>jstl</artifactId>
                    <groupId>javax.servlet</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>1.1.8</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-lang</artifactId>
                    <groupId>commons-lang</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-digester</artifactId>
                    <groupId>commons-digester</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <overlays>
                        <overlay>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>alfresco-web-framework-commons</artifactId>
                            <classifier>webapp</classifier>
                            <excludes>
                                <exclude>WEB-INF/classes/*</exclude>
                                <exclude>WEB-INF/lib/*</exclude>
                            </excludes>
                        </overlay>
                    </overlays>
                   <archiveClasses>true</archiveClasses>
                   <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- Profile to run Share in jetty embedded. Invoke build with -Prun-share 
        | Jetty embedded will run the Share war 
        | TODO: run-war works, run fails.Configure the jetty plugin to pick the proper resources folder 
        | TODO: Configure directory scanning and hot reloading -->
    <profiles>
        <profile>
            <id>run-share</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>jetty-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>run-share-in-jetty</id>
                                <goals>
                                    <goal>run-war</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
