<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors.
-
- 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.switchyard.components</groupId>
        <artifactId>switchyard-components-parent</artifactId>
        <version>2.0.0.Alpha2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>switchyard-component-bpm</artifactId>
    <packaging>bundle</packaging>
    <name>SwitchYard: BPM Component</name>
    <url>http://switchyard.org</url>
    <properties>
        <switchyard.osgi.activator>org.switchyard.component.bpm.Activator</switchyard.osgi.activator>
        <switchyard.osgi.export.pkg>
            org.switchyard.component.bpm.*
        </switchyard.osgi.export.pkg>
        <switchyard.osgi.import>
            org.switchyard.*;${switchyard.osgi.import.switchyard.version},
            org.switchyard.config.model;${switchyard.osgi.import.switchyard.version},
            org.hibernate.*;resolution:=optional,
            *
        </switchyard.osgi.import>
        <switchyard.osgi.require.bundle>
            org.jbpm.bpmn2,
            org.jbpm.flow.core,
            org.jbpm.persistence.jpa,
            ${bundleId.jbpm-human-task-orm},
            org.kie.api,
            org.kie.internalapi
        </switchyard.osgi.require.bundle>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <!-- Avoid processing @ delimeter, we use that in license headers -->
                    <useDefaultDelimiters>false</useDefaultDelimiters>
                    <delimiters>
                        <delimiter>${*}</delimiter>
                    </delimiters>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>extract-jbpm-orm</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jbpm</groupId>
                                    <artifactId>jbpm-executor</artifactId>
                                    <version>${version.org.jbpm}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jbpm</groupId>
                                    <artifactId>jbpm-human-task-audit</artifactId>
                                    <version>${version.org.jbpm}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jbpm</groupId>
                                    <artifactId>${artifactId.jbpm-human-task-orm}</artifactId>
                                    <version>${version.org.jbpm}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jbpm</groupId>
                                    <artifactId>jbpm-kie-services</artifactId>
                                    <version>${version.org.jbpm}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jbpm</groupId>
                                    <artifactId>jbpm-persistence-jpa</artifactId>
                                    <version>${version.org.jbpm}</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                            <includes>META-INF/*orm.xml</includes>
                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <!-- internal dependencies -->
        <dependency>
            <groupId>org.switchyard.components</groupId>
            <artifactId>switchyard-component-common-knowledge</artifactId>
        </dependency>
        <!-- external dependencies -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-audit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-bpmn2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-flow</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-flow-builder</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-human-task-audit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-human-task-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-human-task-workitems</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-kie-services</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-persistence-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-runtime-manager</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-shared-services</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-workitems</artifactId>
        </dependency>
        <!-- OSGi dependencies (build) -->
        <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>
    </dependencies>
    <profiles>
        <profile>
            <id>components-bpm-profile-product</id>
            <activation>
                <property>
                    <name>switchyard.product</name>
                </property>
            </activation>
            <properties>
                <artifactId.jbpm-human-task-orm>jbpm-human-task-core</artifactId.jbpm-human-task-orm>
                <bundleId.jbpm-human-task-orm>org.jbpm.services.task</bundleId.jbpm-human-task-orm>
            </properties>
        </profile>
        <profile>
            <id>components-bpm-profile-community</id>
            <activation>
                <property>
                    <name>!switchyard.product</name>
                </property>
            </activation>
            <properties>
                <artifactId.jbpm-human-task-orm>jbpm-human-task-jpa</artifactId.jbpm-human-task-orm>
                <bundleId.jbpm-human-task-orm>org.jbpm.services.task.jpa</bundleId.jbpm-human-task-orm>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.jbpm</groupId>
                    <artifactId>jbpm-human-task-jpa</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
