<!--
  ~ 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</groupId>
        <artifactId>process-project</artifactId>
        <version>7.2.0.redhat-024</version>
        <relativePath>..</relativePath>
    </parent>

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

    <name>${project.artifactId}</name>
    <description>Fuse Process :: Manager</description>

    <properties>
<!--
        <fuse.osgi.embed.dependency>*;groupId=org.fusesource.process;path-</fuse.osgi.embed.dependency>
-->
        <fuse.osgi.resource>${basedir}/target/classes/process-launcher.tar.gz,{maven-resources}</fuse.osgi.resource>
        <fuse.osgi.export>
            org.fusesource.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.2,4)",
            *
        </fuse.osgi.import>
        <fuse.osgi.private.pkg>
            org.fusesource.process.manager.utils,
        </fuse.osgi.private.pkg>
        <!--
                <fuse.osgi.activator>org.fusesource.process.manager.Activator</fuse.osgi.activator>
        -->
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.fusesource.fabric.fab</groupId>
            <artifactId>fab-osgi</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.fusesource.fabric</groupId>
            <artifactId>process-launcher</artifactId>
            <version>${project.version}</version>
            <classifier>bin</classifier>
            <type>tar.gz</type>
            <scope>test</scope>
        </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>org.ops4j.pax.url</groupId>
            <artifactId>pax-url-mvn</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.fusesource.fabric</groupId>
            <artifactId>fabric-utils</artifactId>
        </dependency>
        <dependency>
            <groupId>org.fusesource.fabric</groupId>
            <artifactId>fabric-zookeeper</artifactId>
        </dependency>
        <dependency>
            <groupId>org.fusesource.fabric</groupId>
            <artifactId>fabric-linkedin-zookeeper</artifactId>
        </dependency>
        <dependency>
            <groupId>org.fusesource.fabric</groupId>
            <artifactId>fabric-core</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>

        <!-- testing -->
        <dependency>
            <groupId>org.fusesource.fabric.samples</groupId>
            <artifactId>process-sample-camel-spring</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <workingDirectory>target</workingDirectory>
                    <excludes>
                        <!-- TODO - exclude for now until we've an install task -->
                        <exclude>**/ProcessControllerTest.*</exclude>
                    </excludes>
                </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>
                <version>${exec-maven-plugin-version}</version>
                <configuration>
                    <mainClass>org.fusesource.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>
        </plugins>

    </build>

</project>
