<!--
  Copyright (C) FuseSource, Inc.
  http://fusesource.com

  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>org.fusesource.fabric.bridge</groupId>
    <artifactId>fabric-bridge-project</artifactId>
    <version>7.2.0.redhat-083</version>
  </parent>

  <artifactId>fabric-bridge</artifactId>
  <packaging>bundle</packaging>

  <name>${project.artifactId}</name>
  <description>Fuse Fabric :: ActiveMQ Network Bridge</description>

  <properties>
    <commons-pool-version>1.5.4</commons-pool-version>
    <!--fon.osgi.activator>org.fusesource.fabric.bridge.Activator</fon.osgi.activator-->
    <fuse.osgi.import>
      *
    </fuse.osgi.import>
    <fuse.osgi.export>
      !org.fusesource.fabric.bridge.internal,
      org.fusesource.fabric.bridge,
      org.fusesource.fabric.bridge.*
    </fuse.osgi.export>
    <fuse.osgi.private.pkg>
      org.fusesource.fabric.bridge.internal
    </fuse.osgi.private.pkg>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-utils</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-broker</artifactId>
    </dependency>

    <!--
        <dependency>
          <groupId>org.osgi</groupId>
          <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
          <groupId>org.osgi</groupId>
          <artifactId>org.osgi.compendium</artifactId>
        </dependency>
    -->
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-pool</artifactId>
      <version>${activemq-version}</version>
    </dependency>
    <dependency>
      <groupId>commons-pool</groupId>
      <artifactId>commons-pool</artifactId>
      <version>${commons-pool-version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jms</artifactId>
      <version>${spring-version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-api-version}</version>
    </dependency>
  </dependencies>

  <build>
    <!--
          <resources>
            <resource>
              <directory>${project.build.directory}/generated-resources/</directory>
            </resource>
            <resource>
              <directory>src/main/resources</directory>
            </resource>
          </resources>
    -->
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <!--
                                    <Bundle-Activator>org.fusesource.fabric.activemq.Activator</Bundle-Activator>
            -->
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.sun.tools.jxc.maven2</groupId>
        <artifactId>maven-jaxb-schemagen-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <project>${project}</project>
          <!--destdir>${project.build.directory}/META-INF</destdir-->
          <srcdir>${project.build.directory}/../src/main/java</srcdir>
          <excludes>
            <exclude>**/internal/*</exclude>
            <exclude>**/spring/*</exclude>
            <exclude>**/Abstract*</exclude>
          </excludes>
          <schemas>
            <schema>
              <namespace>http://fusesource.org/fabric/bridge</namespace>
              <file>fabric-bridge.xsd</file>
            </schema>
          </schemas>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>xml-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>transform</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <transformationSets>
            <transformationSet>
              <dir>${project.build.directory}/generated-schema</dir>
              <outputDir>${project.basedir}/src/main/resources/META-INF</outputDir>
              <stylesheet>generateSpringSchema.xslt</stylesheet>
            </transformationSet>
          </transformationSets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12</version>
        <configuration>
          <excludes>
            <!-- ESB-1687 -->
            <exclude>**/SourceConnectorTest.*</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>


  <profiles>
    <profile>
      <id>add-tools-jar-if-exists</id>
      <activation>
        <file>
          <exists>${java.home}/../lib/tools.jar</exists>
        </file>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.sun.tools.jxc.maven2</groupId>
              <artifactId>maven-jaxb-schemagen-plugin</artifactId>
              <version>1.2</version>
              <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>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
