<?xml version="1.0" encoding="UTF-8"?>
<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>com.googlecode.redbox-mint</groupId>
    <artifactId>mint</artifactId>
    <version>1.5.1</version>
    <packaging>pom</packaging>
    <name>The Mint</name>
    <parent>
        <groupId>com.googlecode.redbox-mint</groupId>
        <artifactId>mint-project</artifactId>
        <version>1.5.1</version>
        <relativePath>parent/pom.xml</relativePath>
    </parent>
    <modules>
        <module>config</module>
        <module>parent</module>
        <module>plugins/sru/sruclient</module>
        <module>plugins/transaction/curation</module>
        <module>plugins/transformer/handle</module>
        <module>plugins/transformer/local</module>
    </modules>
    <!-- Typically these would be provided by an institutional build, but
         these are ok for fallback defaults and/or debugging values. -->
    <properties>
        <server.port>9001</server.port>
        <amq.port>9201</amq.port>
        <amq.stomp.port>9202</amq.stomp.port>
        <dir.home>${project.home}/home</dir.home>
        <dir.portal>${project.home}/portal</dir.portal>
        <dir.server>${project.home}/server</dir.server>
        <dir.solr>${project.home}/solr</dir.solr>
        <dir.storage>${project.home}/storage</dir.storage>
        <dir.geonames>${dir.home}/geonames/solr</dir.geonames>
        <server.url.base>http://${ip.address}:${server.port}/mint/</server.url.base>
        <smtp.host>localhost</smtp.host>
        <admin.email>admin@localhost</admin.email>
        <!-- Control scripts try to auto-detect proxy. Use this value if you
             want Java to specifically exclude certain hosts from proxying. -->
        <non.proxy.hosts>localhost</non.proxy.hosts>
    </properties>
    <dependencies>
        <!-- Fascinator -->
        <dependency>
            <groupId>com.googlecode.the-fascinator</groupId>
            <artifactId>fascinator-portal</artifactId>
            <type>war</type>
            <classifier>skinny</classifier>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator</groupId>
            <artifactId>fascinator-common</artifactId>
        </dependency>
        <!-- Solr Web App -->
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr</artifactId>
            <version>3.3.0</version>
            <type>war</type>
        </dependency>
        <!-- Geonames Web App + harvester-->
        <dependency>
            <groupId>com.googlecode.solr-geonames</groupId>
            <artifactId>solr-geonames-server</artifactId>
            <type>war</type>
            <classifier>skinny</classifier>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.solr-geonames</groupId>
            <artifactId>solr-geonames-harvester</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- Jetty Web Server -->
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jsp-2.1-jetty</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-spring</artifactId>
            <version>${jetty.version}</version>
            <exclusions>
                <!-- Facsinator will bring JCL-over-SLF4J.
                     Although the logback JARs must be in
                     Jetty's own /lib folder.
                     http://logback.qos.ch/faq.html#setup_jetty
                -->
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>start</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <!-- Mint Content -->
        <dependency>
            <groupId>com.googlecode.redbox-mint</groupId>
            <artifactId>mint-config</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.redbox-mint</groupId>
            <artifactId>plugin-transaction-curation-mint</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.redbox-mint</groupId>
            <artifactId>sruclient-mint</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!-- Contrib plugins -->
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-harvester-skos</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-harvester-csv</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-transformer-jsonVelocity</artifactId>
            <version>1.1.1</version>
        </dependency>
        <!-- Fascinator Plugins -->
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-access-derby</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-authentication-internal</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-harvester-oai-pmh</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-harvester-workflow</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-indexer-solr</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-roles-internal</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-storage-filesystem</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.the-fascinator.plugins</groupId>
            <artifactId>plugin-subscriber-solrEventLog</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Use Groovy to define a clean path to the top level directory.
                 Windows pathing can be problematic, so we fix that here too -->
            <plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>default</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>${pom.basedir}/setup.groovy</source>
                        </configuration>
                    </execution>
                    <execution>
                        <id>clean</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>${pom.basedir}/setup.groovy</source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deploy-server</id>

            <!-- Allows downstream POMs to trigger this profile by
                 adding a marker file to the project root -->
            <activation>
                <file>
                    <exists>deploy.server</exists>
                </file>
            </activation>

            <dependencies>
                <!-- Needs the warpath plugin, so errors outside this build profile -->
                <dependency>
                    <groupId>com.googlecode.the-fascinator</groupId>
                    <artifactId>fascinator-portal</artifactId>
                    <type>warpath</type>
                    <version>${fascinator.version}</version>
                </dependency>
            </dependencies>

            <!-- The standard build/deploy process for making a server -->
            <build>
                <resources>
                    <resource>
                        <directory>src/main/config/home</directory>
                    </resource>
                    <resource>
                        <directory>src/main/config/portal</directory>
                    </resource>
                    <resource>
                        <directory>src/main/config/server</directory>
                    </resource>
                    <resource>
                        <directory>src/main/config/solr</directory>
                    </resource>
                </resources>
                <plugins>
                    <!-- Support retrieving dependencies from WAR artifacts -->
                    <plugin>
                        <groupId>org.appfuse</groupId>
                        <artifactId>maven-warpath-plugin</artifactId>
                        <version>2.0.2</version>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>add-classes</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Remove previously deployed files -->
                    <plugin>
                        <artifactId>maven-clean-plugin</artifactId>
                        <version>2.4.1</version>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>${dir.server}</directory>
                                    <includes>
                                        <include>lib/*.jar</include>
                                        <include>plugins/*.jar</include>
                                    </includes>
                                </fileset>
                            </filesets>
                        </configuration>
                    </plugin>
                    <!-- Copy dependencies and configuration resources -->
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.1</version>
                        <executions>
                            <!-- Unpack SKOS harvest config -->
                            <execution>
                                <id>unpack-harvest-config</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <includeGroupIds>com.googlecode.the-fascinator.plugins</includeGroupIds>
                                    <includeArtifactIds>plugin-harvester-skos</includeArtifactIds>
                                    <includes>harvest/**,data/**</includes>
                                    <outputDirectory>${dir.home}</outputDirectory>
                                </configuration>
                            </execution>
                            <!-- Unpack common workflow configuration -->
                            <execution>
                                <id>unpack-workflows</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <includes>workflows/**</includes>
                                    <outputDirectory>${dir.home}/harvest</outputDirectory>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>com.googlecode.the-fascinator</groupId>
                                            <artifactId>fascinator-common</artifactId>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <!-- Fascinator + Geonames applications -->
                            <execution>
                                <id>copy-webapp</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${dir.server}/webapps</outputDirectory>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>com.googlecode.the-fascinator</groupId>
                                            <artifactId>fascinator-portal</artifactId>
                                            <type>war</type>
                                            <classifier>skinny</classifier>
                                            <destFileName>portal.war</destFileName>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>com.googlecode.solr-geonames</groupId>
                                            <artifactId>solr-geonames-server</artifactId>
                                            <type>war</type>
                                            <classifier>skinny</classifier>
                                            <destFileName>geonames.war</destFileName>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <!-- Unpack Solr WAR -->
                            <execution>
                                <id>unpack-solr-war</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <!-- Make sure we don't unpack the bundled logging JAR.
                                         Fascinator will provide logback instead. -->
                                    <excludes>WEB-INF/lib/slf4j-jdk14-1.6.1.jar</excludes>
                                    <outputDirectory>${dir.server}/webapps/solr</outputDirectory>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.apache.solr</groupId>
                                            <artifactId>solr</artifactId>
                                            <type>war</type>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <!-- Unpack default Solr configuration -->
                            <execution>
                                <id>unpack-solr-config</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <includes>solr/**</includes>
                                    <outputDirectory>${project.home}</outputDirectory>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>com.googlecode.the-fascinator.plugins</groupId>
                                            <artifactId>plugin-indexer-solr</artifactId>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <!-- Unpack default Fascinator portal -->
                            <execution>
                                <id>unpack-portal</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <includes>portal/**</includes>
                                    <outputDirectory>${project.home}</outputDirectory>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>com.googlecode.the-fascinator</groupId>
                                            <artifactId>fascinator-portal</artifactId>
                                            <type>war</type>
                                            <classifier>skinny</classifier>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <!-- Fascinator plugins (without dependencies) -->
                            <execution>
                                <id>copy-plugins</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <includeGroupIds>com.googlecode.the-fascinator.plugins</includeGroupIds>
                                    <outputDirectory>${dir.server}/plugins</outputDirectory>
                                    <excludeTransitive>true</excludeTransitive>
                                </configuration>
                            </execution>
                            <!-- Plugin dependencies + Geo harvester -->
                            <execution>
                                <id>copy-plugin-dependencies</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <excludeTypes>war,warpath</excludeTypes>
                                    <excludeGroupIds>com.googlecode.the-fascinator.plugins,org.mortbay.jetty</excludeGroupIds>
                                    <outputDirectory>${dir.server}/lib</outputDirectory>
                                </configuration>
                            </execution>
                            <!-- Jetty launcher -->
                            <execution>
                                <id>copy-jetty-start</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.mortbay.jetty</groupId>
                                            <artifactId>start</artifactId>
                                        </artifactItem>
                                    </artifactItems>
                                    <outputDirectory>${dir.server}/jetty</outputDirectory>
                                    <stripVersion>true</stripVersion>
                                </configuration>
                            </execution>
                            <!-- Jetty dependencies -->
                            <execution>
                                <id>copy-jetty-dependencies</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <includeGroupIds>org.mortbay.jetty</includeGroupIds>
                                    <excludeArtifactIds>start</excludeArtifactIds>
                                    <outputDirectory>${dir.server}/jetty/lib</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <repositories>
        <repository>
            <id>fascinator-snapshots</id>
            <url>http://dev.redboxresearchdata.com.au/nexus/content/repositories/central-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>redbox-nexus</id>
            <url>http://dev.redboxresearchdata.com.au/nexus/content/groups/public/</url>
        </repository>
    </repositories>
    <scm>
        <url>http://redbox-mint.googlecode.com/svn/mint/tags/mint-1.5.1</url>
        <connection>scm:svn:http://redbox-mint.googlecode.com/svn/mint/tags/mint-1.5.1</connection>
        <developerConnection>scm:svn:https://redbox-mint.googlecode.com/svn/mint/tags/mint-1.5.1</developerConnection>
    </scm>
</project>