<?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/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>org.eurekaclinical</groupId>
	<artifactId>eureka</artifactId>
	<version>2.0-Alpha-25</version>
	<packaging>pom</packaging>
	<name>Eureka! Clinical Analytics</name>
	<description>Eureka! Clinical Analytics is a web application that
		provides you with an easy way to phenotype a patient population based
		on their clinical and administrative data, and load those phenotypes
		and data into your own instance of the i2b2 data warehouse system.
	</description>
	<url>https://github.com/eurekaclinical/eureka.git</url>
	<inceptionYear>2012</inceptionYear>
	
	<parent>
		<groupId>org.eurekaclinical</groupId>
		<artifactId>eurekaclinical-parent-standard-deps</artifactId>
		<version>1-Alpha-4</version>
	</parent>
	
	<scm>
		<developerConnection>scm:git:https://github.com/eurekaclinical/eureka.git</developerConnection>
		<connection>scm:git:https://github.com/eurekaclinical/eureka.git</connection>
		<url>https://github.com/eurekaclinical/eureka.git</url>
		<tag>eureka-2.0-Alpha-25</tag>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/eurekaclinical/eureka/issues</url>
	</issueManagement>

	<!-- define the package versions for various project we will use -->
	<properties>
		<!-- Populates links to the website from Eureka. -->
		<aiw.site.url>http://eurekaclinical.org</aiw.site.url>
		<eureka.support.email>help@eurekaclinical.org</eureka.support.email>
		<eureka.build.timestamp>${maven.build.timestamp}</eureka.build.timestamp>
		<eureka.dev.site.url>${project.url}</eureka.dev.site.url>
		<currentStableVersion>1.8</currentStableVersion>
		<poi-version>3.9</poi-version>
		<jstl-version>1.2</jstl-version>
		<jsp-api-version>2.0</jsp-api-version>
		<jaxb-version>2.2.7</jaxb-version>
		<commons-fileupload-version>1.3</commons-fileupload-version>
		<protempa-version>3.0-Alpha-12</protempa-version>
		<aiw-i2b2-etl-version>2.0-Alpha-24</aiw-i2b2-etl-version>
		<aiw-neo4j-etl-version>1.0-Alpha-3</aiw-neo4j-etl-version>
		<freemarker-version>2.3.20</freemarker-version>
		<ehcache-version>2.6.0</ehcache-version>
		<tomcat-plugin-version>1.1</tomcat-plugin-version>
		<scribe-up-ext-version>1.0-Alpha-4</scribe-up-ext-version>

		<!-- properties for site creation -->
		<javautil-version>3.0-Alpha-7</javautil-version>
		<hibernate-hbm2ddl-auto>validate</hibernate-hbm2ddl-auto>

		<cas-server-version>2.0-Alpha-5</cas-server-version>

		<!-- transitive dependencies that CAS needs certain versions of...-->
		<commons-codec-version>1.4</commons-codec-version>
		
		<tomcat.httpsPort>8443</tomcat.httpsPort>
		
		<eurekaclinical-common-version>1.0-Alpha-2</eurekaclinical-common-version>
	</properties>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
			<distribution>manual</distribution>
		</license>
		<license>
			<name>GNU General Public License, Version 3</name>
			<url>http://www.gnu.org/licenses/gpl-3.0-standalone.html</url>
			<distribution>manual</distribution>
		</license>
	</licenses>

	<modules>
		<module>eureka-common</module>
		<module>eureka-webapp</module>
		<module>eureka-services</module>
		<module>eureka-protempa-etl</module>
		<module>eureka-ear</module>
	</modules>

	<!-- make sure our code complies with Java 1.6 specifications, and define
	the name of the WAR file to create -->
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>net.alchim31.maven</groupId>
					<artifactId>yuicompressor-maven-plugin</artifactId>
					<executions>
						<execution>
							<phase>prepare-package</phase>
							<goals>
								<goal>compress</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<encoding>UTF-8</encoding>
						<linebreakpos>-1</linebreakpos>
						<nosuffix>false</nosuffix>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.jasig.maven</groupId>
					<artifactId>maven-notice-plugin</artifactId>
					<configuration>
						<noticeTemplate>etc/NOTICE.template</noticeTemplate>
						<licenseMapping>
							<param>etc/license-mappings.xml</param>
						</licenseMapping>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<systemProperties>
							<java.awt.headless>true</java.awt.headless>
						</systemProperties>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-checkstyle-plugin</artifactId>
					<version>2.10</version>
				</plugin>
				<plugin>
					<groupId>org.liquibase</groupId>
					<artifactId>liquibase-maven-plugin</artifactId>
					<version>3.4.2</version>
					<configuration>
						<logging>WARNING</logging>
						<outputFileEncoding>${project.build.sourceEncoding}</outputFileEncoding>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>org.liquibase.ext</groupId>
							<artifactId>liquibase-hibernate4.2</artifactId>
							<version>3.4</version>
						</dependency>
						<dependency>
							<groupId>org.hibernate</groupId>
							<artifactId>hibernate-core</artifactId>
							<version>${hibernate-version}</version>
						</dependency>
						<dependency>
							<groupId>org.hibernate</groupId>
							<artifactId>hibernate-entitymanager</artifactId>
							<version>${hibernate-version}</version>
						</dependency>
						<dependency>
							<groupId>org.hibernate</groupId>
							<artifactId>hibernate-envers</artifactId>
							<version>${hibernate-version}</version>
						</dependency>
						<dependency>
							<groupId>org.slf4j</groupId>
							<artifactId>slf4j-api</artifactId>
							<version>${slf4j-version}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>2.10</version>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<configuration>
					<licenseName>apache2_gpl3</licenseName>
					<licenseResolver>file:src/license</licenseResolver>
					<roots>
						<root>src/main</root>
						<root>src/test/java/</root>
					</roots>
					<extraExtensions>
						<!-- .xsd files are not supported by default -->
						<!-- but should be commented in XML style -->
						<xsd>xml</xsd>
					</extraExtensions>
					<excludes>
						<exclude>**/*.htm</exclude>
						<exclude>**/*.html</exclude>
						<exclude>**/*.js</exclude>
						<exclude>**/*.css</exclude>
						<exclude>**/*.json</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<id>first</id>
						<goals>
							<goal>update-file-header</goal>
						</goals>
						<phase>process-sources</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<inherited>false</inherited>
				<configuration>
					<descriptors>
						<descriptor>assembly/src.xml</descriptor>
					</descriptors>
					<tarLongFileMode>posix</tarLongFileMode>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-context.xml</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/tomcat-config</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/main/resources/tomcat-server-config</directory>
									<filtering>true</filtering>
									<includes>
										<include>context.xml</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-cert</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/tomcat-config</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/main/resources/tomcat-server-config</directory>
									<filtering>false</filtering>
									<includes>
										<include>localhost.keystore</include>
										<include>localhost.truststore</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-logging.properties-file</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/eureka-config</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/main/resources/tomcat-eureka-config</directory>
									<includes>
										<include>logging.properties</include>
									</includes>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-application.properties-file</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/eureka-config/eureka</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/main/resources/tomcat-eureka-config/eureka</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
				<dependencies>
					<dependency>
						<groupId>org.jasig.cas.client</groupId>
						<artifactId>cas-client-core</artifactId>
						<version>${cas-client-version}</version>
						<exclusions>
							<exclusion>
								<groupId>javax.servlet</groupId>
								<artifactId>servlet-api</artifactId>
							</exclusion>
						</exclusions>
					</dependency>
					<dependency>
						<groupId>commons-codec</groupId>
						<artifactId>commons-codec</artifactId>
						<version>${commons-codec-version}</version>
						<scope>compile</scope>
					</dependency>
				</dependencies>
				<configuration>
					<warSourceDirectory>${project.build.directory}/${project.build.finalName}</warSourceDirectory>
					<port>${tomcat.port}</port>
					<httpsPort>${tomcat.httpsPort}</httpsPort>
					<keystorePass>changeit</keystorePass>
					<keystoreFile>conf/localhost.keystore</keystoreFile>
					<keystoreType>JKS</keystoreType>
					<additionalConfigFilesDir>${project.build.directory}/tomcat-config</additionalConfigFilesDir>
					<systemProperties>
						<org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH>true</org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH>
						<javax.net.ssl.trustStore>${project.build.directory}/tomcat/conf/localhost.truststore</javax.net.ssl.trustStore>
						<javax.net.ssl.trustStorePassword>changeit</javax.net.ssl.trustStorePassword>
						<eureka.config.dir>${project.build.directory}/eureka-config/eureka</eureka.config.dir>
						<java.util.logging.config.file>${project.build.directory}/eureka-config/logging.properties</java.util.logging.config.file>
					</systemProperties>
					<webapps>
						<webapp>
							<groupId>org.eurekaclinical</groupId>
							<artifactId>eureka-webapp</artifactId>
							<version>${project.version}</version>
							<type>war</type>
							<asWebapp>true</asWebapp>
						</webapp>
						<webapp>
							<groupId>org.eurekaclinical</groupId>
							<artifactId>eureka-services</artifactId>
							<version>${project.version}</version>
							<type>war</type>
							<asWebapp>true</asWebapp>
						</webapp>
						<webapp>
							<groupId>org.eurekaclinical</groupId>
							<artifactId>eureka-protempa-etl</artifactId>
							<version>${project.version}</version>
							<type>war</type>
							<asWebapp>true</asWebapp>
						</webapp>
						<webapp>
							<groupId>org.eurekaclinical</groupId>
							<artifactId>cas-server</artifactId>
							<version>${cas-server-version}</version>
							<type>war</type>
							<asWebapp>true</asWebapp>
						</webapp>
					</webapps>
					<addContextWarDependencies>true</addContextWarDependencies>
					<addWarDependenciesInClassloader>true</addWarDependenciesInClassloader>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<additionalparam>-Xdoclint:none</additionalparam>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<!-- define our dependencies -->
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.apache.poi</groupId>
				<artifactId>poi-ooxml</artifactId>
				<version>${poi-version}</version>
			</dependency>
			<dependency>
				<groupId>jstl</groupId>
				<artifactId>jstl</artifactId>
				<version>${jstl-version}</version>
			</dependency>
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>jsp-api</artifactId>
				<version>${jsp-api-version}</version>
				<scope>provided</scope>
				<exclusions>
					<exclusion>
						<groupId>javax.servlet</groupId>
						<artifactId>servlet-api</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>com.sun.xml.bind</groupId>
				<artifactId>jaxb-impl</artifactId>
				<version>${jaxb-version}</version>
			</dependency>
			<dependency>
				<groupId>commons-fileupload</groupId>
				<artifactId>commons-fileupload</artifactId>
				<version>${commons-fileupload-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>eureka-common</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>eureka-common</artifactId>
				<version>${project.version}</version>
				<scope>test</scope>
				<type>test-jar</type>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>eureka-services</artifactId>
				<type>war</type>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>eureka-webapp</artifactId>
				<type>war</type>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>eureka-protempa-etl</artifactId>
				<type>war</type>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>protempa-framework</artifactId>
				<version>${protempa-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>protempa-bconfigs-ini4j-ini</artifactId>
				<version>${protempa-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>protempa-tsb-umls</artifactId>
				<version>${protempa-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>protempa-dsb-file</artifactId>
				<version>${protempa-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>protempa-dsb-relationaldb</artifactId>
				<version>${protempa-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>aiw-i2b2-etl</artifactId>
				<version>${aiw-i2b2-etl-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>aiw-neo4j-etl</artifactId>
				<version>${aiw-neo4j-etl-version}</version>
			</dependency>
			<dependency>
				<groupId>org.freemarker</groupId>
				<artifactId>freemarker</artifactId>
				<version>${freemarker-version}</version>
			</dependency>
			<dependency>
				<groupId>net.sf.ehcache</groupId>
				<artifactId>ehcache</artifactId>
				<version>${ehcache-version}</version>
				<type>pom</type>
			</dependency>
			<dependency>
				<groupId>com.sun.jersey.contribs</groupId>
				<artifactId>jersey-multipart</artifactId>
				<version>${jersey-version}</version>
			</dependency>
			<dependency>
				<groupId>com.sun.jersey.contribs</groupId>
				<artifactId>jersey-apache-client</artifactId>
				<version>${jersey-version}</version>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>javautil</artifactId>
				<version>${javautil-version}</version>
			</dependency>
			<!-- These are pulled into eureka-services and eureka-protempa-etl
			by other dependencies, but CAS requires them to be in
			$CATALINA_HOME/lib. The versions CAS requires are newer than those
			that are pulled in. So we specify the versions and make them
			provided so they are there at compile time but not pulled into the
			warfiles.
			-->
			<dependency>
				<groupId>commons-codec</groupId>
				<artifactId>commons-codec</artifactId>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>commons-logging</groupId>
				<artifactId>commons-logging</artifactId>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.eurekaclinical</groupId>
				<artifactId>scribe-up-ext</artifactId>
				<version>${scribe-up-ext-version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
	
	<dependencies>
		<dependency>
			<groupId>org.eurekaclinical</groupId>
			<artifactId>eurekaclinical-common</artifactId>
			<version>${eurekaclinical-common-version}</version>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>release-profile</id>
			<properties>
				<eureka.stage>PRODUCTION</eureka.stage>
			</properties>
		</profile>
		<profile>
			<id>eureka-tomcat-local</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>tomcat-maven-plugin</artifactId>
						<version>${tomcat-plugin-version}</version>
						<configuration>
							<url>${local.url}</url>
							<server>eureka.tomcat.local</server>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>eureka-tomcat-dev</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>tomcat-maven-plugin</artifactId>
						<version>${tomcat-plugin-version}</version>
						<configuration>
							<url>${dev.url}</url>
							<server>eureka.tomcat.dev</server>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>

