<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">

    <!--
       Licensed to the Apache Software Foundation (ASF) under one or more
       contributor license agreements. See the NOTICE file distributed
       with this work for additional information regarding copyright
       ownership. The ASF licenses this file to you under the Apache
       License, Version 2.0 (the "License"); you may not use this file
       except in compliance with the License. You may obtain a copy of
       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
       required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
       implied. See the License for the specific language governing
       permissions and limitations under the License.
    -->

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.dspace</groupId>
        <artifactId>dspace-parent</artifactId>
        <version>6.3</version>
        <relativePath>..</relativePath>
    </parent>

    <groupId>org.dspace</groupId>
    <artifactId>dspace-solr</artifactId>
    <name>Apache Solr Webapp</name>
    <description>Apache Solr Server</description>
    <packaging>war</packaging>

    <properties>
        <!-- WARNING: When updating this dependency be sure to check the "zookeeper" pinned version !-->
        <solr.version>4.10.4</solr.version>
        <!-- 'root.basedir' is the path to the root [dspace-src] dir. It must be redefined by each child POM,
             as it is used to reference the LICENSE_HEADER and *.properties file(s) in that directory. -->
        <root.basedir>${basedir}/..</root.basedir>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <!-- This 'dspace-solr' WAR overlays the Apache Solr Web Application
                         available in Maven Central -->
                    <overlays>
                        <overlay>
                            <groupId>org.apache.solr</groupId>
                            <artifactId>solr</artifactId>
                            <!--
                            Exclude the solr core named apache-solr-core, this is needed because the dspace-solr changes
                            need to take precendence over the solr-core, the solr-core will still be loaded in the solr-core.jar
                            -->
                            <excludes>
                                <exclude>WEB-INF/lib/apache-solr-core-${solr.version}.jar</exclude>
                            </excludes>
                        </overlay>
                    </overlays>
                    <!-- Filter the web.xml (needed for IDE compatibility/debugging) -->
                    <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                </configuration>
                <executions>
                    <execution>
                        <!-- This execution creates a normal WAR (with all JARs, etc)-->
                        <id>webapp</id>
                        <configuration>
                            <primaryArtifact>true</primaryArtifact>
                            <archiveClasses>true</archiveClasses>
                            <attachClasses>true</attachClasses>
                            <classesClassifier>classes</classesClassifier>
                            <warSourceExcludes>WEB-INF/classes/**</warSourceExcludes>
                            <packagingExcludes>
                                WEB-INF/classes/**,
                                WEB-INF/lib/slf4j-jdk14-*.jar,
                                WEB-INF/lib/log4j-over-slf4j-*.jar
                            </packagingExcludes>
                        </configuration>
                        <goals>
                            <goal>war</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                    <execution>
                        <!-- This execution creates a "skinny" WAR (without any JARs included)-->
                        <id>skinny</id>
                        <configuration>
                            <primaryArtifact>false</primaryArtifact>
                            <classifier>skinny</classifier>
                            <warSourceExcludes>WEB-INF/lib/**,WEB-INF/classes/**</warSourceExcludes>
                            <packagingExcludes>WEB-INF/lib/**,WEB-INF/classes/**</packagingExcludes>
                        </configuration>
                        <goals>
                            <goal>war</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Depends on the Apache 'solr' web application (see Overlay settings above)-->
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr</artifactId>
            <version>${solr.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-core</artifactId>
            <version>${solr.version}</version>
            <type>jar</type>
            <exclusions>
                <exclusion>
                    <groupId>jdk.tools</groupId>
                    <artifactId>jdk.tools</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>javax.servlet</artifactId>
                    <groupId>org.eclipse.jetty.orbit</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-continuation</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-deploy</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-http</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-io</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-jmx</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-security</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-server</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-servlet</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-util</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-webapp</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-xml</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
            </exclusions>              
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-cell</artifactId>
            <version>${solr.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>javax.servlet</artifactId>
                    <groupId>org.eclipse.jetty.orbit</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-continuation</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-deploy</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-http</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-io</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-jmx</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-security</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-server</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-servlet</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-util</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-webapp</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-xml</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Replace J.U.L. logging with log4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>1.7.14</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <artifactId>log4j</artifactId>
            <groupId>log4j</groupId>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
         </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.zookeeper</groupId>
                <artifactId>zookeeper</artifactId>
                <version>3.4.11</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>
