<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.mule.distributions</groupId>
        <artifactId>mule-distributions</artifactId>
        <version>3.1.5-SNAPSHOT</version>
    </parent>
    <artifactId>mule-standalone-light</artifactId>
    <!-- Packaging 'pom' ensures that maven does not try to bind a plugin to the
         'package' phase. We bind the assembly plugin here, that's enough. -->
    <packaging>pom</packaging>
    <name>Lightweight Standalone Distribution</name>
    <description>This distribution does not include things such as docs + examples in order to keep the size down for experienced users</description>

    <properties>
        <communityDistDir>${project.build.directory}/ce-distribution</communityDistDir>
        <communityArtifact>mule-standalone</communityArtifact>
        <licensePath>../../LICENSE_HEADER.txt</licensePath>
    </properties>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <!--
                    Keep the plugins ordered by build lifecycle
                    (http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)!
                -->
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <!--
                                     This has to happen early in the build lifecycle so that plugins running
                                     later in the build lifecycle can work on the unpacked distro.
                                     -->
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <skip>${skipDistributions}</skip>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.mule.distributions</groupId>
                                            <artifactId>${communityArtifact}</artifactId>
                                            <version>${project.version}</version>
                                            <type>zip</type>
                                            <outputDirectory>${communityDistDir}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <!--
                                        'attached' ensures there's only a single run bound to m2's lifecycle.
                                        The default 'assembly' goal would run every plugin in this pom twice.
                                    -->
                                    <goal>attached</goal>
                                </goals>
                                <configuration>
                                    <finalName>mule-standalone-nodocs-${project.version}</finalName>
                                    <descriptors>
                                        <descriptor>assembly.xml</descriptor>
                                    </descriptors>
                                    <appendAssemblyId>false</appendAssemblyId>
                                    <tarLongFileMode>gnu</tarLongFileMode>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.mule.tools</groupId>
                        <artifactId>mule-assembly-verifier</artifactId>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <projectOutputFile>mule-standalone-nodocs-${project.version}.zip</projectOutputFile>
                            <!-- Default is under src/main/resources, pull it to the root for this project -->
                            <whitelist>assembly-whitelist.txt</whitelist>
                            <!--
                                Blacklisted entries are supposed to be part of the distribution,
                                but not verified. They are defined by their full path relative to the
                                distribution *archive*; therefore we need to specify the name of the
                                toplevel subdirectory in the archive too.
                            -->
                            <blacklist>
                                <entry>mule-standalone-nodocs-${project.version}/lib/endorsed/xml-apis-1.3.04.jar</entry>
                                <entry>mule-standalone-nodocs-${project.version}/lib/endorsed/xercesImpl-2.9.1.jar</entry>
                                <entry>mule-standalone-nodocs-${project.version}/lib/endorsed/xml-serializer-2.7.1.jar</entry>
                                <entry>mule-standalone-nodocs-${project.version}/lib/endorsed/xalan-2.7.2.jar</entry>
                            </blacklist>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>
</project>
