<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">


    <parent>
        <groupId>org.wso2.caching</groupId>
        <artifactId>wso2caching</artifactId>
        <version>3.2</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>wso2caching-mar</artifactId>
    <packaging>jar</packaging>
    <version>3.2</version>
    <name>WSO2 Caching module - Mar</name>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>mar</id>
                        <phase>package</phase>
                        <configuration>
                            <tasks>
                                <mkdir dir="target/temp"/>
                                <copy toDir="target/temp">
                                    <fileset dir="target/classes">
                                        <include name="**/*.class"/>
                                        <include name="**/*.xml"/>
                                    </fileset>
                                </copy>
                                <mkdir dir="target/temp/lib"/>
                                <copy file="../core/target/wso2caching-core-${wso2caching.version}.jar"
                                      tofile="target/temp/lib/wso2caching-core-${wso2caching.version}.jar"/>
                                <jar destfile="target/wso2caching-${wso2caching.version}.mar">
                                    <fileset dir="target/temp"/>
                                </jar>
                                <!--<copy file="target/${pom.artifactId}-${wso2caching.version}.jar"-->
                                <!--tofile="target/wso2caching-${wso2caching.version}.mar"/>-->
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>mar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>target/wso2caching-${wso2caching.version}.mar</file>
                                    <!--<file>target/${pom.artifactId}-${wso2caching.version}.mar</file>-->
                                    <type>mar</type>
                                </artifact>
                            </artifacts>
                            <finalName>wso2caching-${pom.version}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.wso2.caching</groupId>
            <artifactId>wso2caching-core</artifactId>
            <version>3.2</version>
        </dependency>
    </dependencies>

</project>
