<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.solacesystems</groupId>
        <artifactId>solsuite</artifactId>
        <version>10.4.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>com.solacesystems</groupId>
    <artifactId>sol-jms</artifactId>
    <packaging>jar</packaging>
    <name>Solace JMS API</name>
    <description>Solace JMS API</description>

    <url>http://dev.solace.com/tech/jms-api/</url>

    <properties>
        <test.ant.target>test</test.ant.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.annotation</artifactId>
        </dependency>
		<!-- https://mvnrepository.com/artifact/com.jcraft/jzlib -->
		<dependency>
			<groupId>com.jcraft</groupId>
			<artifactId>jzlib</artifactId>
			<version>1.0.7</version>
		</dependency>			
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jms_1.1_spec</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-all</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.solacesystems</groupId>
            <artifactId>solrconf</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
            <resource>
                <directory>../sol-jcsmp/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${basedir}/..</directory>
                <includes>
                    <include>README.txt</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>../sol-common/src/main/java</source>
                                <source>../sol-jcsmp/src/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <copyPom>true</copyPom>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-test-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/test-dependency</outputDirectory>
                            <copyPom>true</copyPom>
                            <includeScope>test</includeScope>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-solace-jars</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>sol-common</artifactId>
                                    <version>${project.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>sol-common</artifactId>
                                    <version>${project.version}</version>
                                    <type>pom</type>
                                    <overWrite>true</overWrite>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>sol-jcsmp</artifactId>
                                    <version>${project.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>sol-jcsmp</artifactId>
                                    <version>${project.version}</version>
                                    <type>pom</type>
                                    <overWrite>true</overWrite>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>README.txt</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestSections>
                            <manifestSection>
                                <name>com/solacesystems/jms</name>
                                <manifestEntries>
                                    <Specification-Title>Java Message Service</Specification-Title>
                                    <Specification-Version>1.1</Specification-Version>
                                    <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
                                    <Implementation-Title>com.solacesystems.jms</Implementation-Title>
                                    <Implementation-Version>${project.version}</Implementation-Version>
                                    <Implementation-Vendor>Solace Corporation.</Implementation-Vendor>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                    <excludes>
                        <exclude>README.txt</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <niceManifest>true</niceManifest>
                    <instructions>
                        <Export-Package>
                            com.solacesystems.common.xa;version="${project.version}",
                            com.solacesystems.jms;version="${project.version}",
                            com.solacesystems.jms.events;version="${project.version}",
                            com.solacesystems.jms.impl;version="${project.version}",
                            com.solacesystems.jndi;version="${project.version}"
                        </Export-Package>
                        <Import-Package>
                            !com.solacesystems.common.xa;version="${project.version}",
                            !com.solacesystems.jms;version="${project.version}",
                            !com.solacesystems.jms.events;version="${project.version}",
                            !com.solacesystems.jms.impl;version="${project.version}",
                            !com.solacesystems.jndi;version="${project.version}",
                            javax.jms,*
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <aggregate>false</aggregate>
                    <encoding>cp1252</encoding>
                    <bottom><![CDATA[<i>Copyright 2004-2018 Solace Corporation. All rights reserved.</i>]]></bottom>
                    <author>false</author>
                    <version>true</version>
                    <use>true</use>
                    <windowtitle>Solace JMS API v${project.version}</windowtitle>
                    <doctitle><![CDATA[<h1>Solace JMS API</h1>]]></doctitle>
                    <overview>${basedir}/docs/specs/Overview.html</overview>
                    <show>public</show>
                    <links>
                        <link>http://docs.oracle.com/javase/1.5.0/docs/api</link>
                        <link>http://docs.oracle.com/javaee/5/api</link>
                    </links>
                    <groups>
                        <group>
                            <title>Solace JMS API</title>
                            <packages>com.solacesystems.jms*:com/solacesystems/jndi*:javax.jms</packages>
                        </group>
                        <group>
                            <title>Utilities for Solace Messaging API for Java</title>
                            <packages>com.solacesystems.common*</packages>
                        </group>
                    </groups>
                    <sourceFileIncludes>
                        <include>javax/jms/*.java</include>
                        <include>com/solacesystems/jms/impl/SolJMSConstants.java</include>
                        <include>com/solacesystems/jms/impl/SolJMSErrorCodes.java</include>
                        <include>com/solacesystems/jms/SolEventSource.java</include>
                        <include>com/solacesystems/jms/ConfigurationException.java</include>
                        <include>com/solacesystems/jms/SupportedProperty.java</include>
                        <include>com/solacesystems/jms/SolXAConnectionFactory.java</include>
                        <include>com/solacesystems/jms/SolConnectionEventSource.java</include>
                        <include>com/solacesystems/jms/SolConnectionEventListener.java</include>
                        <include>com/solacesystems/jms/SolConnectionFactory.java</include>
                        <include>com/solacesystems/jms/SolTopic.java</include>
                        <include>com/solacesystems/jms/SolQueue.java</include>
                        <include>com/solacesystems/jms/SolReferenceableDelegate.java</include>
                        <include>com/solacesystems/jms/SolProducerEventSource.java</include>
                        <include>com/solacesystems/jms/SolProducerEventListener.java</include>
                        <include>com/solacesystems/jms/SolConsumerEventSource.java</include>
                        <include>com/solacesystems/jms/SolConsumerEventListener.java</include>
                        <include>com/solacesystems/jms/SolEventListener.java</include>
                        <include>com/solacesystems/jms/SolEventSource.java</include>
                        <include>com/solacesystems/jms/SolJmsUtility.java</include>
                        <include>com/solacesystems/jms/events/*.java</include>
                        <include>com/solacesystems/jndi/SolJNDIInitialContextFactory.java</include>
                        <include>com/solacesystems/common/xa/SolXid.java</include>
                    </sourceFileIncludes>
                    <sourcepath>${basedir}/docs/specs;${basedir}/src/main/java;${basedir}/src/main/java-templates;${basedir}/../sol-common/src/main/java;${basedir}/../sol-jcsmp/src/main/java</sourcepath>
                </configuration>
                <executions>
                      <execution>
                        <id>internal</id>
                        <phase>package</phase>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                        <configuration>
                            <reportOutputDirectory>${project.reporting.outputDirectory}/internal</reportOutputDirectory>
                            <destDir>apidocs</destDir>
                            <nohelp>false</nohelp>
                        </configuration>
                      </execution>
                      <execution>
                        <id>external</id>
                        <phase>package</phase>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <reportOutputDirectory>${project.reporting.outputDirectory}/external</reportOutputDirectory>
                            <destDir>apidocs</destDir>
                            <nohelp>true</nohelp>
                        </configuration>
                      </execution>
                      <execution>
                        <id>external_doclet</id>
                        <phase>package</phase>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <reportOutputDirectory>${project.reporting.outputDirectory}/external</reportOutputDirectory>
                            <destDir>api_doclets</destDir>
                            <nohelp>true</nohelp>
                            <doclet>com.solacesystems.buildtools.doclet.SolaceDoclet</doclet>
                            <docletArtifacts>
                                <docletArtifact>
                                    <groupId>com.solacesystems</groupId>
                                    <artifactId>sol-build-tools</artifactId>
                                    <version>1.0</version>
                                </docletArtifact>
                            </docletArtifacts>
                            <sourceFileIncludes>
                                <include>com/solacesystems/jms/impl/SolJMSConstants.java</include>
                                <include>com/solacesystems/jms/impl/SolJMSErrorCodes.java</include>
                                <include>com/solacesystems/jms/SolEventSource.java</include>
                                <include>com/solacesystems/jms/ConfigurationException.java</include>
                                <include>com/solacesystems/jms/SupportedProperty.java</include>
                                <include>com/solacesystems/jms/SolConnectionEventSource.java</include>
                                <include>com/solacesystems/jms/SolConnectionEventListener.java</include>
                                <include>com/solacesystems/jms/SolTopic.java</include>
                                <include>com/solacesystems/jms/SolQueue.java</include>
                                <include>com/solacesystems/jms/SolReferenceableDelegate.java</include>
                                <include>com/solacesystems/jms/SolProducerEventSource.java</include>
                                <include>com/solacesystems/jms/SolProducerEventListener.java</include>
                                <include>com/solacesystems/jms/SolConsumerEventSource.java</include>
                                <include>com/solacesystems/jms/SolConsumerEventListener.java</include>
                                <include>com/solacesystems/jms/SolEventListener.java</include>
                                <include>com/solacesystems/jms/SolEventSource.java</include>
                                <include>com/solacesystems/jms/SolJmsUtility.java</include>
                                <include>com/solacesystems/jms/events/*.java</include>
                                <include>com/solacesystems/jndi/SolJNDIInitialContextFactory.java</include>
                                <include>com/solacesystems/common/xa/SolXid.java</include>
                            </sourceFileIncludes>
                         </configuration>
                      </execution>
                </executions>               
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.ant</groupId>
                        <artifactId>ant-junit</artifactId>
                        <version>1.8.2</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>         
                        <id>process_docs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <copy todir="${project.reporting.outputDirectory}/external/apidocs/com">
                                    <fileset dir="${project.reporting.outputDirectory}/external/api_doclets/com"/>
                                </copy>
                            </target>
                        </configuration>
                    </execution>
                    <execution>         
                        <id>RunUnitTests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <skip>${skipTests}</skip>
                            <target>
                                <ant
                                    target="${test.ant.target}"
                                    dir="${basedir}"
                                    antfile="${basedir}/build.xml">
                                    <property name="dir.test.results" value="target/surefire-reports"/>
                                    <property name="compile_classpath" refid="maven.compile.classpath"/>
                                    <property name="test_classpath" refid="maven.test.classpath"/>
                                    <property name="runtime_classpath" refid="maven.runtime.classpath"/>
                                </ant>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>javadoc_and_samples</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <skipAssembly>false</skipAssembly>
                            <descriptors>
                                <descriptor>javadoc.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                    <execution>
                        <id>assembly</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <descriptors>
                                <descriptor>internal.xml</descriptor>
                                <descriptor>release.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <encoding>cp1252</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>templating-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>filter-jcsmp-srcs</id>
                        <goals>
                            <goal>filter-sources</goal>
                        </goals>
                        <configuration>              
                        <sourceDirectory>${basedir}/../sol-jcsmp/src/main/java-templates</sourceDirectory>
                        <outputDirectory>${project.build.directory}/generated-sources/java-templates</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>bundleBaseline</id>
            <activation>
                <property>
                    <name>bundleCheck</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>biz.aQute.bnd</groupId>
                        <artifactId>bnd-baseline-maven-plugin</artifactId>
                        <configuration>
                            <base>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <version>${bundle.base.version}</version>
                            </base>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
