<!--

     Copyright 2005-2014 Red Hat, Inc.

     Red Hat licenses this file to you 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>io.fabric8</groupId>
    <artifactId>process-project</artifactId>
    <version>1.2.0.Beta2</version>
  </parent>

  <artifactId>process-manager</artifactId>
  <packaging>bundle</packaging>

  <name>Fabric8 :: Process :: Manager</name>

  <properties>
    <!--
            <fuse.osgi.embed.dependency>*;groupId=io.fabric8.process;path-</fuse.osgi.embed.dependency>
    -->
    <fuse.osgi.resource>${basedir}/target/classes/process-launcher.tar.gz,{maven-resources}</fuse.osgi.resource>
    <fuse.osgi.export>
      io.fabric8.process.manager*;version=${project.version};-noimport:=true,
    </fuse.osgi.export>
    <fuse.osgi.import>
      org.apache.felix.service.command,
      org.apache.felix.gogo.commands,
      org.apache.karaf.shell.console;version="[2.3,4)",
      *
    </fuse.osgi.import>
    <fuse.osgi.private.pkg>
      io.fabric8.process.manager.utils,
    </fuse.osgi.private.pkg>
    <!--
            <fuse.osgi.activator>io.fabric8.process.manager.Activator</fuse.osgi.activator>
    -->
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.fabric8.fab</groupId>
      <artifactId>fab-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric-boot-commands</artifactId>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>common-util</artifactId>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric-zookeeper</artifactId>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.karaf.shell</groupId>
      <artifactId>org.apache.karaf.shell.console</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mvel</groupId>
      <artifactId>mvel2</artifactId>
    </dependency>

    <!-- Provided Dependencies -->
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.scr.annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.fabric8.samples</groupId>
      <artifactId>process-sample-camel-spring</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.url</groupId>
      <artifactId>pax-url-aether</artifactId>
      <version>${pax.url.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>process-launcher</artifactId>
      <version>${project.version}</version>
      <classifier>bin</classifier>
      <type>tar.gz</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <workingDirectory>target</workingDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/classes/fusehq-agent.json</file>
                  <type>json</type>
                  <classifier>tomcat</classifier>
                </artifact>
                <artifact>
                  <file>target/classes/tomcat.json</file>
                  <type>json</type>
                  <classifier>fusehq-agent</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <configuration>
          <mainClass>io.fabric8.process.manager.GenerateControllerKinds</mainClass>
          <classpathScope>test</classpathScope>
          <systemProperties>
            <systemProperty>
              <key>basedir</key>
              <value>${basedir}</value>
            </systemProperty>
            <systemProperty>
              <key>groupId</key>
              <value>${project.groupId}</value>
            </systemProperty>
            <systemProperty>
              <key>version</key>
              <value>${project.version}</value>
            </systemProperty>
          </systemProperties>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>process-test-classes</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-scr-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>scr</goal>
            </goals>
            <configuration>
              <specVersion>1.2</specVersion>
              <strictMode>false</strictMode>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <Gravia-Enabled>true</Gravia-Enabled>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
