<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.mulesoft.connectors</groupId>
        <artifactId>mule-openas2-impl</artifactId>
        <version>1.0.2</version>
    </parent>

    <artifactId>mule-openas2-osgi-impl</artifactId>

    <name>OpenAS2 OSGi Bundle</name>
    <description>
        OpenAS2 server OSGi bundle
    </description>

    <properties>
        <mainClass>org.openas2.osgi.Activator</mainClass>
        <project.dist.package.name>${project.parent.artifactId}Bundle-${project.version}.zip</project.dist.package.name>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <lib.dir>${project.basedir}/lib</lib.dir>
        <help.filename>OpenAS2HowTo.pdf</help.filename>
        <help.file.src>../docs/${help.filename}</help.file.src>
        <dist.dir>${project.basedir}/dist</dist.dir>
    </properties>

    <build>
        <plugins>
            <!--TODO it's not clear how the artifact is distributed-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <!--Copy artifact to build lib dicetory -->
                                <copy file="${project.build.directory}/${project.build.finalName}.jar"
                                      todir="${project.build.directory}/dist/lib" verbose="true"/>
                                <!-- Add the help PDF version to the distro -->
                                <copy file="${help.file.src}" todir="${project.build.directory}/dist" verbose="true"/>
                                <!-- create distribution package -->
                                <zip destfile="${project.basedir}/dist/${project.dist.package.name}"
                                     basedir="${project.build.directory}/dist"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.connectors</groupId>
            <artifactId>mule-openas2-server-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

</project>