<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>samples</artifactId>
        <groupId>org.aperteworkflow</groupId>
        <version>3.2-RC1</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>application-case</artifactId>
    <packaging>bundle</packaging>
    <name>application-case</name>

    <dependencies>
        <dependency>
            <artifactId>case-management</artifactId>
            <groupId>org.aperteworkflow</groupId>
            <version>3.2-RC1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <useDefaultManifestFile>true</useDefaultManifestFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <version>${maven.bundle.version}</version>
                <configuration>
                    <instructions>
                        <Import-Package>
                            pl.net.bluesoft.casemanagement,
                            pl.net.bluesoft.rnd.processtool.ui.basewidgets,
                            org.aperteworkflow.files,
                            *;resolution:=optional
                        </Import-Package>
                        <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                        <Bundle-SymbolicName>org.aperteworkflow.samples.application</Bundle-SymbolicName>
                        <Bundle-Version>0.1</Bundle-Version>
                        <Embed-Directory>lib</Embed-Directory>
                        <Embed-Transitive>true</Embed-Transitive>
                        <ProcessTool-I18N-Property>messages</ProcessTool-I18N-Property>
                        <Case-Deployment>Application.xml</Case-Deployment>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- Profil dev do automatycznego kopiowania jarow do osgi -->
    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>copy-installed</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>${project.artifactId}</artifactId>
                                            <type>jar</type>
                                            <version>${project.version}</version>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${osgi.dir}</outputDirectory>
                                            <destFileName>${project.artifactId}-${project.version}.jar</destFileName>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>