<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2014 Internet2

    Licensed 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.

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

    <parent>
        <groupId>edu.internet2.middleware.grouper</groupId>
        <artifactId>grouper-ws-parent</artifactId>
        <version>1.99.1</version>
        <relativePath>../../grouper-ws</relativePath>
    </parent>

    <name>Grouper WS</name>
    <description>Internet2 Groups Management WS Core</description>
    <artifactId>grouper-ws</artifactId>
    <packaging>jar</packaging>
    <version>1.99.1</version>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>grouper</artifactId>
            <version>${project.version}</version>
        </dependency>
<!--
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
-->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.security</groupId>
            <artifactId>wss4j</artifactId>
            <version>1.6.19</version>
            <exclusions>
                <exclusion>
                    <groupId>xalan</groupId>
                    <artifactId>xalan</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
            <version>1.6.4</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-activation_1.1_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-javamail_1.4_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-jta_1.1_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-stax-api_1.0_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <!-- jsr311-api package javax.ws.rs.core conflicts with Jersey's which uses classes from jakarta.ws.rs-api-2.1.6 -->
                <exclusion>
                    <groupId>javax.ws.rs</groupId>
                    <artifactId>jsr311-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-transport-http</artifactId>
            <version>1.6.4</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- axis2-transport-http pulls in org.apache.httpcomponents:httpclient 4.5.3 which pulls httpcore 4.4.6,
             while aws-java-sdk-core pulls httpclient 4.5.5 -> httpcore 4.4.9 -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-transport-local</artifactId>
            <version>1.6.1</version>
            <scope>runtime</scope>
        </dependency>
        <!-- dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>2.1.11</version>
        </dependency -->
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>1.6.3</version>
        </dependency>
        <!-- DEBUG SWAGGER JSON BUILD -->
        <!--   dependency>
            <groupId>com.github.kongchen</groupId>
            <artifactId>swagger-maven-plugin</artifactId>
            <version>3.1.8</version>
        </dependency -->
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-adb</artifactId>
            <version>1.6.1</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-activation_1.1_spec</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.rampart</groupId>
            <artifactId>rampart-core</artifactId>
            <version>1.6.3</version><!-- version 1.6.1 has issues with trying to get opensaml dep from non-existent shibboleth repo -->
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.opensaml</groupId>
                    <artifactId>openws</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ca.juliusdavies</groupId>
                    <artifactId>not-yet-commons-ssl</artifactId>
                </exclusion>

                <exclusion>
                    <groupId>org.apache.velocity</groupId>
                    <artifactId>velocity</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.owasp.esapi</groupId>
                    <artifactId>esapi</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xerces</groupId>
                    <artifactId>xercesImpl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xml-resolver</groupId>
                    <artifactId>xml-resolver</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.woodstox</groupId>
                    <artifactId>woodstox-core-asl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xalan</groupId>
                    <artifactId>serializer</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xalan</groupId>
                    <artifactId>xalan</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-javamail_1.4_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-activation_1.1_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk15on</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- rampart-core 1.6.3 depends on bcprov-jdk15on 1.49, while grouper-ws-scim
             has a transitive dependency on bcprov-jdk15on 1.59 -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>1.70</version>
        </dependency>
        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>3.6</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>grouper</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <!-- still undetermined dependencies (provided in lib dir but jdeps doesn't show any use)
        axis2-xmlbeans-1.6.1.jar
        axis2-adb-codegen-1.6.1.jar
        axis2-codegen-1.6.1.jar
        axis2-java2wsdl-1.6.1.jar
        axis2-xmlbeans-1.6.1.jar
        cron-parser-core-3.4.jar
        ddlutils-1.0.jar
        ehcache-core-2.4.8.jar
        stax-1.2.0.jar (stax-api is pulled in by ddlutils, suitable replacement?)
        xmlbeans-2.3.0.jar
        xmltooling-1.2.0.jar
        xom-1.1.jar
        -->

        <!-- Dependencies for SCIM 2 -->
        <dependency>
            <groupId>com.unboundid.product.scim2</groupId>
            <artifactId>scim2-sdk-server</artifactId>
            <version>2.3.7</version>
            <exclusions>
                <!-- this has a dep on jackson-core 2.10.2; but jackson-datatype-jsr310 plus other grouper modules are
                already pulling in jackson-core 2.14.0 -->
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
                <!-- pulling in version 2.10.2; we want 2.14.0 to match jackson-core 2.14.0 in use by grouper -->
                <exclusion>
                    <groupId>com.fasterxml.jackson.jaxrs</groupId>
                    <artifactId>jackson-jaxrs-base</artifactId>
                </exclusion>
                <!-- pulling in version 2.10.2; we want 2.14.0 to match jackson-core 2.14.0 in use by grouper -->
                <exclusion>
                    <groupId>com.fasterxml.jackson.jaxrs</groupId>
                    <artifactId>jackson-jaxrs-json-provider</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- add in the newer version of 2 dependencies needed for scim2-sdk-server -->
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-base</artifactId>
            <version>2.14.0</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
            <version>2.14.0</version>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <version>2.36</version>
        </dependency>
        <!-- without this, gets error "InjectionManagerFactory not found" -->
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
            <version>2.36</version>
        </dependency>
        <!-- without this, gets error "MessageBodyWriter not found for media type=application/scim+json" -->
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>2.36</version>
        </dependency>
        <!-- needed for LocalDateTime unmarshalling -->
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>2.14.0</version>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>1.6.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <version>1.6.5</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
    <build>
        <sourceDirectory>src/grouper-ws</sourceDirectory>
        <testSourceDirectory>src/test</testSourceDirectory>
        
        <resources>
            <resource>
                <directory>conf</directory>
                <includes>
                    <!--include>grouper-ws.base.properties</include-->
                    <include>jaas.conf</include>
                    <include>krb5.eample.conf</include>
                </includes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>confForTest</directory>
            </testResource>
            <!--
            <testResource>
                <directory>../../grouper/confForTest</directory>
            </testResource>
            <testResource>
                <directory>../../grouper/conf</directory>
            </testResource>
            -->
        </testResources>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals><goal>add-source</goal></goals>
                        <configuration>
                            <sources>
                                <source>src/grouper-ws_v1_6</source>
                                <source>src/grouper-ws_v2_0</source>
                                <source>src/grouper-ws_v2_1</source>
                                <source>src/grouper-ws_v2_2</source>
                                <source>src/grouper-ws_v2_3</source>
                                <source>src/grouper-ws_v2_4</source>
                                <source>src/grouper-ws_v2_5</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifestEntries>
                            <Specification-Title>${project.name}</Specification-Title>
                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                            <Implementation-Title>${project.artifactId}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>3.1.8</version>
                <configuration>
                    <skipSwaggerGeneration>true</skipSwaggerGeneration>
                    <apiSources>
                      <apiSource>
                            <springmvc>false</springmvc>
                            <locations>
                              <location>edu.internet2.middleware.grouper.ws.rest.GrouperServiceRest</location>
                              <location>edu.internet2.middleware.grouper.ws.coresoap.GrouperService</location>
                            </locations>
                            <schemes><scheme>https</scheme></schemes>
                            <host>grouper.institution.edu</host>
                            <basePath></basePath>
                            <info>
                                <title>Grouper Web Services</title>
                                <version>v2.6.1</version>
                                <description>Grouper Web Service operations.  Substitute vX_Y_AAA with the client version, e.g. v2_6_001.  Note: the base URL and authentication are institution specific.</description>
                            </info>
                            <swaggerDirectory>${basedir}/webapp/docs/</swaggerDirectory>
                            <swaggerFileName>index</swaggerFileName>
                            <outputFormats>json</outputFormats>
                <swaggerDirectory>${basedir}/webapp/docs</swaggerDirectory>
                        </apiSource>
                    </apiSources>
                </configuration>
                <executions>
                    <execution>
                        <phase>site</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
          <!--  plugin>
            <groupId>com.greensopinion.swagger</groupId>
            <artifactId>jaxrs-gen</artifactId>
            <version>1.3.5</version>
            <configuration>
              <apiVersion>1.0</apiVersion>
              <apiBasePath>/api/latest</apiBasePath>
              <packageNames>
                <param>edu.internet2.middleware.grouper.ws</param>
                <param>edu.internet2.middleware.grouper.ws.coresoap</param>
              </packageNames>
              <outputFolder>${basedir}/webapp/docs</outputFolder>
            </configuration>
            <executions>
              <execution>
                <phase>compile</phase>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
          </plugin -->
        </plugins>
    </build>

</project>
