<?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>
    
    <name>CIPRES Portal Web Application</name>
    <!--<name>BRN-R43 PORTAL</name>--> 
    <groupId>org.ngbw</groupId>
    <artifactId>cipresweb</artifactId>
    <version>2.0</version>
    <packaging>war</packaging>
    
    <parent>
        <groupId>org.ngbw</groupId>
        <artifactId>cipres</artifactId>
        <version>2.0</version>
        <relativePath>../build</relativePath>
    </parent>

    <properties>
        <copyright.year>2020</copyright.year>
        <treedraw.python.exe/>
        <treedraw.phy.fi/>
        <treedraw.tmpdir/>
        <jersey.version>2.28</jersey.version>
        <struts.version>2.3.36</struts.version>
        <jstl.version>1.1.2</jstl.version>
        <struts.menu.version>2.4.3</struts.menu.version>
    </properties>

    <profiles>
        <profile>
            <id>default-tools.jar</id>
            <activation>
                <property>
                    <name>java.vendor</name>
                    <value>Sun Microsystems Inc.</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>1.5.0</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>iplant</id>
            <activation>
                <property>
                    <name>iplant</name>
                    <value>1</value>
                </property>
            </activation>
            <properties>
                <iplant.enabled>1</iplant.enabled>
            </properties>
        </profile>
    </profiles>

    <build>
        <sourceDirectory>${build.dir}/portal/src/main/java</sourceDirectory>
        <testSourceDirectory>${build.dir}/portal/src/test/java</testSourceDirectory>
        <directory>${build.dir}/portal/target</directory>
        <filters>
            <filter>${filter.file.path}</filter>
        </filters>
        <finalName>${build.portal.appName}</finalName>
        <plugins>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.21</version>
                <configuration>
                    <!-- contextPath>/</contextPath -->
                    <scanIntervalSeconds>1</scanIntervalSeconds>
                    <scanTargetPatterns>
                        <scanTargetPattern>
                            <directory>${build.dir}/portal/src/main/webapp/WEB-INF</directory>
                            <excludes>
                                <exclude>**/*.jsp</exclude>
                            </excludes>
                            <includes>
                                <include>**/*.properties</include>
                                <include>**/*.xml</include>
                            </includes>
                        </scanTargetPattern>
                    </scanTargetPatterns>
                    <connectors>
                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>9090</port>
                            <maxIdleTime>60000</maxIdleTime>
                        </connector>
                    </connectors>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <!-- downloadSources>false</downloadSources -->
                    <wtpversion>2.0</wtpversion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>code-generation</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <!-- 
                        <phase>process-resources</phase>
                        first step of process resources is to filter and copy them.  Then we'll run ant
                        on the filtered pisexml files in the target directory. 
                        -->
                        <phase>generate-resources</phase>
                        <configuration>
                            <executable>ant</executable>
                            <arguments>
                                <argument>-Dbuild.portal.staticUrl=${build.portal.staticUrl}</argument>
                                <argument>-f</argument>
                                <argument>${build.dir}/portal/src/main/codeGeneration/build.xml</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.3</version>
                <configuration>
                    <archive>
                        <manifestFile>${build.dir}/portal/src/main/webapp/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                    <warSourceDirectory>${build.dir}/portal/src/main/webapp</warSourceDirectory>
                    <webResources>
                        <resource>
                            <directory>${build.dir}/portal/src/main/webapp</directory>
                            <filtering>true</filtering>
                            <includes>
                                <include>WEB-INF/web.xml</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <!--
                I added this plugin element to disable tests on build by default.
                Apparently there is a version incompatability with the version of slf4j
                needed by the junit tests, or the version of commons logging that it uses
                and the version required by log4jdbc in the sdk.  Since I modified this
                pom to pull in specific versions of slf4j jars the tests are broken.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                    <rules><dependencyConvergence/></rules>
                </configuration>
            </plugin>
            
            <!-- ================================================== --> 
            <!-- 
                Tony:   
                    I added the following 'jetty-jspc-maven-plugin' plugin
                    to compile all JSP pages at compile time. We can catch 
                    any syntax errors in JSP pages before deploying. 
            -->
            <!-- ================================================== --> 
            <!--
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-jspc-maven-plugin</artifactId>
                <version>9.4.18.v20190429</version>
                <executions>
                    <execution>
                        <id>jspc</id>
                        <goals>
                            <goal>jspc</goal>
                        </goals>
                        <configuration>
                            <mergeFragment>false</mergeFragment>
                            <generatedClasses>${project.build.directory}/jspc</generatedClasses>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            -->
        </plugins>

        <!-- to enable maven profile -->
        <resources>
            <resource>
                <directory>${build.dir}/portal/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <!--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>
                                            exec-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.0.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>exec</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.glassfish.jersey</groupId>
                <artifactId>jersey-bom</artifactId>
                <version>${jersey.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
		<dependency>
            <scope>test</scope>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.2</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3.3</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.7</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jboss</groupId>
            <artifactId>javassist</artifactId>
            <version>3.7.ga</version>
        </dependency>
        <!-- some special tags for tables and charts -->
        <dependency>
            <groupId>displaytag</groupId>
            <artifactId>displaytag</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl104-over-slf4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- specify version of slf4j, etc,  that agrees with slf version used in sdk.
        Otherwise displaytag pulls in earlier incompatible versions.
        -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.30</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.30</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.30</version>
        </dependency>
        <!-- END specify version of slf4j, etc,  that agrees with slf version used in sdk. -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>${jstl.version}</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>${jstl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-config-browser-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-jasperreports-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-jfreechart-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-pell-multipart-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-sitegraph-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-sitemesh-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-tiles-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-json-plugin</artifactId>
            <version>${struts.version}</version> 
        </dependency>
        <!-- 
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-convention-plugin</artifactId>
            <version>${struts.version}</version>
        </dependency>
        --> 
        <dependency>
            <groupId>struts-menu</groupId>
            <artifactId>struts-menu</artifactId>
            <version>${struts.menu.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>xml-apis</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-compat</artifactId>
            <version>2.2.2</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>2.2.2</version>
        </dependency>
        
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>javax.mail-api</artifactId>
            <version>1.6.2</version>
        </dependency>
        
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.6.2</version>
        </dependency>
        
        <!-- ================================================== -->
        <!-- Jackson JSON -->
        <!-- ================================================== -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.11.0</version>
        </dependency>
        
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.11.0</version>
        </dependency>
        
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
            <version>2.11.0</version>
        </dependency>
        
        <!-- ================================================== -->
        <!-- Jersey Repositories -->
        <!-- ================================================== -->
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet-core</artifactId>
            <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
            <!-- artifactId>jersey-container-servlet</artifactId -->
        </dependency>
        
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
        </dependency>
         
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <!--<version>2.28</version>-->
        </dependency>
        
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-multipart</artifactId>
            <!--<version>2.28</version>-->
        </dependency>
        
        <dependency>
            <groupId>org.glassfish.jersey.test-framework.providers</groupId>
            <artifactId>jersey-test-framework-provider-jdk-http</artifactId>
            <!--<version>2.28</version>-->
        </dependency>
        
        <!-- ================================================== -->
        <!-- Quartz -->
        <!-- ================================================== -->
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
            <version>2.3.2</version>
        </dependency>
        
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz-jobs</artifactId>
            <version>2.3.2</version>
        </dependency>
        
        <!-- ================================================== -->
        <!-- Phoenix SDK -->
        <!-- ================================================== -->
<!--        <dependency>
            <groupId>org.ngbw.cipres</groupId>
            <artifactId>phoenix-sdk</artifactId>
            <version>1.0.0</version>
        </dependency>-->
        
        <!-- ================================================== -->
        <!-- NGBW SDK -->
        <!-- ================================================== -->
        <dependency>
            <groupId>org.ngbw</groupId>
            <artifactId>sdk</artifactId>
            <version>2.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.ngbw.cipres</groupId>
            <artifactId>xsede-sdk</artifactId>
            <version>1.2.2</version>
        </dependency>

        <!-- The tus_servlet. Just testing this out  -->
        <dependency>
            <groupId>org.tus</groupId>
            <artifactId>tus_servlet</artifactId>
            <version>0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.ngbw</groupId>
            <artifactId>tus_cipres</artifactId>
            <version>0.1-SNAPSHOT</version>
        </dependency>

  	<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-oauth2 -->
  	<dependency>
  		<groupId>com.google.apis</groupId>
  		<artifactId>google-api-services-oauth2</artifactId>
  		<version>v2-rev120-1.22.0</version>
  	</dependency>
  	<!-- https://mvnrepository.com/artifact/org.apache.oltu.oauth2/org.apache.oltu.oauth2.client -->
  	<dependency>
  		<groupId>org.apache.oltu.oauth2</groupId>
  		<artifactId>org.apache.oltu.oauth2.client</artifactId>
  		<version>1.0.2</version>
  	</dependency>
  	<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core
  	<dependency>
  		<groupId>org.hibernate</groupId>
  		<artifactId>hibernate-core</artifactId>
  		<version>5.2.3.Final</version>
  	</dependency>
        -->
  	<!-- https://mvnrepository.com/artifact/com.mchange/c3p0 -->
  	<dependency>
  		<groupId>com.mchange</groupId>
  		<artifactId>c3p0</artifactId>
  		<version>0.9.5.2</version>
  	</dependency>
  	<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk16 -->
  	<dependency>
  		<groupId>org.bouncycastle</groupId>
  		<artifactId>bcprov-jdk16</artifactId>
  		<version>1.45</version>
  	</dependency>

    </dependencies>
</project>
