<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>com.legsem.legstar</groupId>
        <artifactId>legstar-transport</artifactId>
        <version>1.5.2</version>
    </parent>
    <artifactId>legstar-cmqrt</artifactId>
    <name>LegStar WebSphere MQ Transport for CICS</name>
    <description>MQ-based connectivity to CICS.</description>

    <properties>
        <legstar-dev-wmq-lib>${legstar-dev-wmq-home}/lib</legstar-dev-wmq-lib> <!-- Used to locate MQ libs -->
    </properties>

    <dependencies>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-messaging</artifactId>
        </dependency>
         <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-commons-transport</artifactId>
        </dependency>
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-coxbapi</artifactId>
        </dependency>
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-coxbrt</artifactId>
        </dependency>
        <!-- This dependency is only necessary to get invoker to
             be distributed with transports standalone distributions.-->
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-invoker</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>simple-jndi</groupId>
            <artifactId>simple-jndi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jms_1.1_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-jaxbgen</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.legsem.legstar</groupId>
            <artifactId>legstar-commons-transport</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <!-- WebSphere MQ libraries are not under Maven but they are needed for test -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                <additionalClasspathElements>
                  <additionalClasspathElement>${legstar-dev-wmq-lib}/com.ibm.mq.jar</additionalClasspathElement>
                  <additionalClasspathElement>${legstar-dev-wmq-lib}/com.ibm.mqjms.jar</additionalClasspathElement>
                  <additionalClasspathElement>${legstar-dev-wmq-lib}/dhbcore.jar</additionalClasspathElement>
                </additionalClasspathElements>
              </configuration>
            </plugin>

            <!-- Bundle the test classes in a jar for use by JMeter -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>test</classifier>
                            <classesDirectory>${project.build.directory}/test-classes</classesDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Assembly generation plugin. Put the result in the source site
            so that it gets uploaded with the site.  -->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assemble/distribution.xml</descriptor>
                                <descriptor>src/assemble/test-distribution.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>


                    <!-- This will check that the distribution file is valid. -->
                    <execution>
                        <id>prepare-integration-tests</id>
                        <phase>pre-integration-test</phase>
                        <configuration>
                            <tasks>
                                <ant antfile="${basedir}/src/main/ant/test-distribution.xml">
                                    <property name="legstar-dev-wmq-lib" value="${legstar-dev-wmq-lib}" />
                                </ant>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                   <!-- This will prepare the zos sources for upload. -->
                    <execution>
                        <id>prepare-deploy-to-zos</id>
                        <phase>generate-resources</phase>
                        <configuration>
                            <tasks>
                                <ant antfile="${basedir}/../src/main/ant/prepare-deploy-to-zos.xml">
                                    <property name="legstarZosVersion" value="${legstarZosVersion}" />
                                </ant>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                    <!-- Generate site files that needs automatic update. -->
                    <execution>
                        <id>build-site</id>
                        <phase>pre-site</phase>
                        <configuration>
                            <tasks>
                                <ant antfile="${basedir}/../src/main/ant/gen-download-xml.xml">
                                    <property name="productID" value="${pom.artifactId}" />
                                    <property name="productName" value="${pom.name}" />
                                    <property name="legstarVersion" value="${parent.version}" />
                                </ant>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                </executions>
            </plugin>

            <!-- Upload z/OS sources. -->
            <plugin>
                <groupId>com.legsem.legstar</groupId>
                <artifactId>zosupload-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>upload-zos-programs</id>
                        <phase>pre-integration-test</phase>
                        <configuration>
                            <hostName>${legstar-dev-zos-host}</hostName>
                            <hostUserId>${legstar-dev-zos-userid}</hostUserId>
                            <hostPassword>${legstar-dev-zos-password}</hostPassword>
                            <inputFolder>target/zos</inputFolder>
                            <remoteFilesPrefix>${legstar-dev-zos-pds-pfx}.${legstarZosVersion}</remoteFilesPrefix>
                        </configuration>
                        <goals>
                            <goal>upload</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>