<!--
Assembly descriptor for the full Mule distribution.
-->
<assembly>
  <id>full</id>
  <formats>
    <format>zip</format>
    <format>tar.gz</format>
  </formats>

  <fileSets>
    <fileSet>
      <directory>../src/main/resources</directory>
      <outputDirectory></outputDirectory>
      <excludes>
          <!-- A separate assembly-osgi.xml is used for OSGi -->
          <exclude>**/osgi/**</exclude>
          <!-- also exclude the Knopflerfish config files -->
          <exclude>**/*.xargs</exclude>
      </excludes>
    </fileSet>

    <!-- Make binary directories executable. -->
    <fileSet>
      <directory>../src/main/resources/bin</directory>
      <outputDirectory>bin</outputDirectory>
      <fileMode>755</fileMode>
    </fileSet>
    <fileSet>
      <directory>../src/main/resources/bin</directory>
      <outputDirectory>bin</outputDirectory>
      <fileMode>644</fileMode>
      <includes>
          <include>*.txt</include>
      </includes>
    </fileSet>
    <fileSet>
      <directory>../src/main/resources/lib/boot/exec</directory>
      <outputDirectory>lib/boot/exec</outputDirectory>
      <fileMode>755</fileMode>
    </fileSet>
    <fileSet>
      <directory>../src/main/resources/lib/boot/exec</directory>
      <outputDirectory>lib/boot/exec</outputDirectory>
      <fileMode>644</fileMode>
      <includes>
          <include>*.txt</include>
      </includes>
    </fileSet>

    <!-- Copy the USAGE.txt file to the root directory for visibility -->
    <fileSet>
      <directory>../src/main/resources/bin</directory>
      <outputDirectory></outputDirectory>
      <includes>
          <include>USAGE.txt</include>
      </includes>
    </fileSet>

    <!-- Copy javadocs ("mvn site:site" must have been run previously) -->
    <fileSet>
      <directory>../../../target/site/apidocs</directory>
      <outputDirectory>docs/api</outputDirectory>
    </fileSet>

    <!-- Copy source bundle ("mvn -DperformRelease=true" must have been run previously) -->
    <fileSet>
      <directory>target</directory>
      <outputDirectory>src</outputDirectory>
      <includes>
          <include>mule-*-src.zip</include>
      </includes>
    </fileSet>

    <!--
    ============================
        Examples
    ============================
    -->

    <!--
    The entire examples directory is copied over first, then for each example, the contents 
    of the "dist" directory (README.txt, pom.xml, build.xml) are copied over, followed by
    the executable scripts.
    -->
    <fileSet>
        <directory>../../../examples</directory>
        <outputDirectory>examples</outputDirectory>
        <excludes>
            <exclude>pom.xml</exclude>
            <exclude>all-examples/**</exclude>
            <exclude>hello-osgi/**</exclude>
            <exclude>**/target/**</exclude> 
            <exclude>**/dist/**</exclude>
            <exclude>**/.*/**</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>**/*.ipr</exclude>
            <exclude>**/*.iws</exclude>
            <!-- Exclude the webapp tests because Ant is not smart enough to deal 
                with multiple Jetty versions. -->
            <exclude>webapp/src/test/**</exclude>
        </excludes>
    </fileSet>

    <!--
    ============================
        Mule Examples: Echo
    ============================
    -->
    <fileSet>
        <directory>../../../examples/echo/dist</directory>
        <outputDirectory>examples/echo</outputDirectory>
    </fileSet>
    <fileSet>
        <directory>../../../examples/echo/dist</directory>
        <outputDirectory>examples/echo</outputDirectory>
        <fileMode>755</fileMode>
        <includes>
            <include>echo</include>
            <include>echo.bat</include>
        </includes>
    </fileSet>

    <!--
    ==================================
        Mule Examples: Error Handler
    ==================================
    -->
    <fileSet>
        <directory>../../../examples/errorhandler/dist</directory>
        <outputDirectory>examples/errorhandler</outputDirectory>
    </fileSet>
    <fileSet>
        <directory>../../../examples/errorhandler/dist</directory>
        <outputDirectory>examples/errorhandler</outputDirectory>
        <fileMode>755</fileMode>
        <includes>
            <include>errorhandler</include>
            <include>errorhandler.bat</include>
        </includes>
    </fileSet>

    <!--
    ============================
        Mule Examples: Hello
    ============================
    -->
    <fileSet>
        <directory>../../../examples/hello/dist</directory>
        <outputDirectory>examples/hello</outputDirectory>
    </fileSet>
    <fileSet>
        <directory>../../../examples/hello/dist</directory>
        <outputDirectory>examples/hello</outputDirectory>
        <fileMode>755</fileMode>
        <includes>
            <include>hello</include>
            <include>hello.bat</include>
        </includes>
    </fileSet>

    <!--
    ===============================
        Mule Examples: Loan Broker
    ===============================
    -->
    <fileSet>
        <directory>../../../examples/loanbroker/dist</directory>
        <outputDirectory>examples/loanbroker</outputDirectory>
    </fileSet>
    <fileSet>
        <directory>../../../examples/loanbroker/dist</directory>
        <outputDirectory>examples/loanbroker</outputDirectory>
        <fileMode>755</fileMode>
        <includes>
            <include>loanbroker</include>
            <include>loanbroker.bat</include>
        </includes>
    </fileSet>
    <!-- Common classes -->      
    <fileSet>
        <directory>../../../examples/loanbroker/common/dist</directory>
        <outputDirectory>examples/loanbroker/common</outputDirectory>
    </fileSet>
    <fileSet>
        <directory>../../../examples/loanbroker/common-tests/dist</directory>
        <outputDirectory>examples/loanbroker/common-tests</outputDirectory>
    </fileSet>
    <!-- Credit Agency EJB -->      
    <fileSet>
        <directory>../../../examples/loanbroker/credit-agency/dist</directory>
        <outputDirectory>examples/loanbroker/credit-agency</outputDirectory>
    </fileSet>
    <!-- LoanBroker ESB -->      
    <fileSet>
        <directory>../../../examples/loanbroker/esb/dist</directory>
        <outputDirectory>examples/loanbroker/esb</outputDirectory>
    </fileSet>
    <!-- OpenEJB needs a direct path to the openejb.conf file (i.e., it can't find it from within a jar) -->
    <fileSet>
        <directory>../../../examples/loanbroker/esb/src/main/resources</directory>
        <outputDirectory>lib/user</outputDirectory>
        <includes>
            <include>openejb.conf</include>
            <include>castor.properties</include>
        </includes>
    </fileSet>
    <!-- LoanBroker ESN -->      
    <fileSet>
        <directory>../../../examples/loanbroker/esn/dist</directory>
        <outputDirectory>examples/loanbroker/esn</outputDirectory>
    </fileSet>
    <!-- LoanBroker BPM -->      
    <fileSet>
        <directory>../../../examples/loanbroker/bpm/dist</directory>
        <outputDirectory>examples/loanbroker/bpm</outputDirectory>
    </fileSet>

    <!--
    =============================
        Mule Examples: Scripting
    =============================
    -->
    <fileSet>
        <directory>../../../examples/scripting/dist</directory>
        <outputDirectory>examples/scripting</outputDirectory>
    </fileSet>
    <fileSet>
        <directory>../../../examples/scripting/dist</directory>
        <outputDirectory>examples/scripting</outputDirectory>
        <fileMode>755</fileMode>
        <includes>
            <include>scripting</include>
            <include>scripting.bat</include>
        </includes>
    </fileSet>

    <!--
    ===============================
        Mule Examples: Stock Quote
    ===============================
    -->
    <fileSet>
        <directory>../../../examples/stockquote/dist</directory>
        <outputDirectory>examples/stockquote</outputDirectory>
    </fileSet>
    <fileSet>
        <directory>../../../examples/stockquote/dist</directory>
        <outputDirectory>examples/stockquote</outputDirectory>
        <fileMode>755</fileMode>
        <includes>
            <include>stockquote</include>
            <include>stockquote.bat</include>
        </includes>
    </fileSet>

    <!--
    ============================
        Mule Examples: Webapp
    ============================
    -->
    <fileSet>
        <directory>../../../examples/webapp/dist</directory>
        <outputDirectory>examples/webapp</outputDirectory>
    </fileSet>
    <!-- Copy configs from other examples -->
    <fileSet>
        <directory>../../../examples/echo/conf</directory>
        <outputDirectory>examples/webapp/conf</outputDirectory>
        <includes>
            <include>echo-config.xml</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>../../../examples/hello/conf</directory>
        <outputDirectory>examples/webapp/conf</outputDirectory>
        <includes>
            <include>hello-http-config.xml</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>../../../examples/loanbroker/esn/conf</directory>
        <outputDirectory>examples/webapp/conf</outputDirectory>
        <includes>
            <include>loan-broker-sync-config.xml</include>
            <include>loan-broker-vm-endpoints-config.xml</include>
        </includes>
    </fileSet>
    <fileSet>
        <directory>../../../examples/stockquote/conf</directory>
        <outputDirectory>examples/webapp/conf</outputDirectory>
        <includes>
            <include>stockquote-rest-config.xml</include>
        </includes>
    </fileSet>
  </fileSets>

    <!--
    ============================
        Libraries
    ============================
    -->

  <!--
       TODO: http://jira.codehaus.org/browse/MASSEMBLY-41 is now fixed.
       Update to use wildcards.

       Unfortunately we still cannot use wildcards, see
       http://jira.codehaus.org/browse/MASSEMBLY-220
  -->
  <dependencySets>
    <!-- Mule bootstrap -->
    <dependencySet>
      <outputDirectory>lib/boot</outputDirectory>
      <includes>
        <include>org.mule.modules:mule-module-boot</include>
        <include>commons-cli:commons-cli</include>
        <include>tanukisoft:wrapper</include>
      </includes>
      <!-- no XML -->
      <excludes>
          <exclude>xml-apis:xml-apis</exclude>
          <exclude>xerces:xercesImpl</exclude>
          <exclude>xerces:xml-serializer</exclude>
          <exclude>xalan:xalan</exclude>
      </excludes>
    </dependencySet>

    <!-- Mule libraries -->
    <dependencySet>
      <outputDirectory>lib/mule</outputDirectory>
      <scope>runtime</scope>
      <includes>
        <!-- Core -->
        <include>org.mule:mule-core</include>
        <!-- Transports -->
        <include>org.mule.transports:mule-transport-axis</include>
        <include>org.mule.transports:mule-transport-bpm</include>
        <include>org.mule.transports:mule-transport-cxf</include>
        <include>org.mule.transports:mule-transport-ejb</include>
        <include>org.mule.transports:mule-transport-email</include>
        <include>org.mule.transports:mule-transport-file</include>
        <include>org.mule.transports:mule-transport-ftp</include>
        <include>org.mule.transports:mule-transport-http</include>
        <include>org.mule.transports:mule-transport-jbpm</include>
        <include>org.mule.transports:mule-transport-jdbc</include>
        <include>org.mule.transports:mule-transport-jms</include>
        <include>org.mule.transports:mule-transport-multicast</include>
        <include>org.mule.transports:mule-transport-quartz</include>
        <include>org.mule.transports:mule-transport-rmi</include>
        <include>org.mule.transports:mule-transport-soap</include>
        <include>org.mule.transports:mule-transport-ssl</include>
        <include>org.mule.transports:mule-transport-stdio</include>
        <include>org.mule.transports:mule-transport-tcp</include>
        <include>org.mule.transports:mule-transport-udp</include>
        <include>org.mule.transports:mule-transport-vm</include>
        <include>org.mule.transports:mule-transport-xmpp</include>
        <!-- Modules -->
        <include>org.mule.modules:mule-module-acegi</include>
        <include>org.mule.modules:mule-module-builders</include>
        <include>org.mule.modules:mule-module-client</include>
        <include>org.mule.modules:mule-module-jaas</include>
        <include>org.mule.modules:mule-module-jbossts</include>
        <include>org.mule.modules:mule-module-management</include>
        <include>org.mule.modules:mule-module-ognl</include>
        <include>org.mule.modules:mule-module-pgp</include>
        <include>org.mule.modules:mule-module-scripting</include>
        <include>org.mule.modules:mule-module-spring-config</include>
        <include>org.mule.modules:mule-module-spring-extras</include>
        <include>org.mule.modules:mule-module-xml</include>
      </includes>
      <excludes>
        <!-- no XML -->
        <exclude>xml-apis:xml-apis</exclude>
        <exclude>xerces:xercesImpl</exclude>
        <exclude>xerces:xml-serializer</exclude>
        <exclude>xalan:xalan</exclude>
    </excludes>
    </dependencySet>

    <!-- Non-Mule libraries -->
    <dependencySet>
      <outputDirectory>lib/opt</outputDirectory>
      <scope>runtime</scope>
      <excludes>
        <!-- Core -->
        <exclude>org.mule:mule-core</exclude>
        <!-- Transports -->
        <exclude>org.mule.transports:mule-transports-all</exclude>
        <exclude>org.mule.transports:mule-transport-axis</exclude>
        <exclude>org.mule.transports:mule-transport-bpm</exclude>
        <exclude>org.mule.transports:mule-transport-cxf</exclude>
        <exclude>org.mule.transports:mule-transport-ejb</exclude>
        <exclude>org.mule.transports:mule-transport-email</exclude>
        <exclude>org.mule.transports:mule-transport-file</exclude>
        <exclude>org.mule.transports:mule-transport-ftp</exclude>
        <exclude>org.mule.transports:mule-transport-http</exclude>
        <exclude>org.mule.transports:mule-transport-jbpm</exclude>
        <exclude>org.mule.transports:mule-transport-jdbc</exclude>
        <exclude>org.mule.transports:mule-transport-jms</exclude>
        <exclude>org.mule.transports:mule-transport-multicast</exclude>
        <exclude>org.mule.transports:mule-transport-quartz</exclude>
        <exclude>org.mule.transports:mule-transport-rmi</exclude>
        <exclude>org.mule.transports:mule-transport-soap</exclude>
        <exclude>org.mule.transports:mule-transport-ssl</exclude>
        <exclude>org.mule.transports:mule-transport-stdio</exclude>
        <exclude>org.mule.transports:mule-transport-tcp</exclude>
        <exclude>org.mule.transports:mule-transport-udp</exclude>
        <exclude>org.mule.transports:mule-transport-vm</exclude>
        <exclude>org.mule.transports:mule-transport-xfire</exclude>
        <exclude>org.mule.transports:mule-transport-xmpp</exclude>
        <!-- Modules -->
        <exclude>org.mule.modules:mule-module-acegi</exclude>
        <exclude>org.mule.modules:mule-modules-all</exclude>
        <exclude>org.mule.modules:mule-module-boot</exclude>
        <exclude>org.mule.modules:mule-module-builders</exclude>
        <exclude>org.mule.modules:mule-module-client</exclude>
        <exclude>org.mule.modules:mule-module-jaas</exclude>
        <exclude>org.mule.modules:mule-module-jbossts</exclude>
        <exclude>org.mule.modules:mule-module-jca</exclude>
        <exclude>org.mule.modules:mule-module-management</exclude>
        <exclude>org.mule.modules:mule-module-ognl</exclude>
        <exclude>org.mule.modules:mule-module-pgp</exclude>
        <exclude>org.mule.modules:mule-module-scripting</exclude>
        <exclude>org.mule.modules:mule-module-spring-config</exclude>
        <exclude>org.mule.modules:mule-module-spring-extras</exclude>
        <exclude>org.mule.modules:mule-module-xml</exclude>
        <!-- Examples -->
        <exclude>org.mule.examples:mule-examples-all</exclude>
        <exclude>org.mule.examples:mule-example-echo</exclude>
        <exclude>org.mule.examples:mule-example-errorhandler</exclude>
        <exclude>org.mule.examples:mule-example-hello</exclude>
        <exclude>org.mule.examples:mule-example-loanbroker-common</exclude>
        <exclude>org.mule.examples:mule-example-loanbroker-esn</exclude>
        <exclude>org.mule.examples:mule-example-loanbroker-esb</exclude>
        <exclude>org.mule.examples:mule-example-loanbroker-bpm</exclude>
        <exclude>org.mule.examples:mule-example-loanbroker-credit-agency</exclude>
        <exclude>org.mule.examples:mule-example-scripting</exclude>
        <exclude>org.mule.examples:mule-example-stockquote</exclude>
        <!-- TODO The following exclusions shouldn't be necessary here if they are kept 
        out in their originating POMs, need to do some transitive dependency debugging
        to figure out who is dragging them into the distro. -->
        <exclude>org.mule.tests:mule-tests-functional</exclude>
        <exclude>javax.activation:activation</exclude>
        <exclude>javax.mail:mail</exclude>
        <exclude>commons-logging:commons-logging</exclude>
        <!-- these two are already in lib/boot -->
        <exclude>commons-cli:commons-cli</exclude>
        <exclude>tanukisoft:wrapper</exclude>

        <exclude>org.apache.activemq:activemq-core</exclude>
        <exclude>org.apache.activemq:activeio-core</exclude>

        <!-- this lib is provided separately in 'profiler' distribution -->
        <exclude>com.yourkit:yjp-controller-api-redist</exclude>

        <!-- no XML -->
        <exclude>xml-apis:xml-apis</exclude>
        <exclude>xerces:xercesImpl</exclude>
        <exclude>xerces:xml-serializer</exclude>
        <exclude>xalan:xalan</exclude>

        <!-- MULE-3044: exclude the wsdl4j artifact from the axis transport -->
        <exclude>axis:axis-wsdl4j</exclude>
      </excludes>
    </dependencySet>

    <!-- Mule examples -->
    <dependencySet>
      <outputDirectory>lib/user</outputDirectory>
      <scope>runtime</scope>
      <!-- Don't put the version number in the examples. -->
      <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
      <includes>
        <include>org.mule.examples:mule-example-echo</include>
        <include>org.mule.examples:mule-example-errorhandler</include>
        <include>org.mule.examples:mule-example-hello</include>
        <include>org.mule.examples:mule-example-loanbroker-common</include>
        <include>org.mule.examples:mule-example-loanbroker-esn</include>
        <include>org.mule.examples:mule-example-loanbroker-esb</include>
        <include>org.mule.examples:mule-example-loanbroker-bpm</include>
        <include>org.mule.examples:mule-example-loanbroker-credit-agency</include>
        <include>org.mule.examples:mule-example-scripting</include>
        <include>org.mule.examples:mule-example-stockquote</include>
      </includes>
      <!-- no XML -->
      <excludes>
          <exclude>xml-apis:xml-apis</exclude>
          <exclude>xerces:xercesImpl</exclude>
          <exclude>xerces:xml-serializer</exclude>
          <exclude>xalan:xalan</exclude>
      </excludes>
    </dependencySet>

    <dependencySet>
      <outputDirectory>lib/user</outputDirectory>
      <scope>test</scope>
      <includes>
        <include>org.mule.tests:mule-tests-core</include>
        <include>org.mule.tests:mule-tests-functional</include>
      </includes>
      <!-- no XML -->
      <excludes>
          <exclude>xml-apis:xml-apis</exclude>
          <exclude>xerces:xercesImpl</exclude>
          <exclude>xerces:xml-serializer</exclude>
          <exclude>xalan:xalan</exclude>
      </excludes>
    </dependencySet>

    <!--
        These XML dependencies end up in the "endorsed" directory
        and must be excluded from other dependencySets, otherwise
        the inclusions here will cause other artifacts to pull them
        in as well. If that happens, the MAVP blacklisting mechanism
        should kick in, since only jars in the endorsed directory are
        explicitly blacklisted by full path.
    -->
    <dependencySet>
      <outputDirectory>lib/endorsed</outputDirectory>
      <includes>
          <include>xml-apis:xml-apis</include>
          <include>xerces:xercesImpl</include>
          <include>xerces:xml-serializer</include>
          <include>xalan:xalan</include>
      </includes>
   </dependencySet>

  </dependencySets>
</assembly>
