<?xml version="1.0" encoding="UTF-8"?>
<!--
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - JOnAS: Java(TM) Open Application Server
  - Copyright (C) 2007-2009 Bull S.A.S.
  - Contact: jonas-team@ow2.org
  -
  - This library is free software; you can redistribute it and/or
  - modify it under the terms of the GNU Lesser General Public
  - License as published by the Free Software Foundation; either
  - version 2.1 of the License, or (at your option) any later version.
  -
  - This library is distributed in the hope that it will be useful,
  - but WITHOUT ANY WARRANTY; without even the implied warranty of
  - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  - Lesser General Public License for more details.
  -
  - You should have received a copy of the GNU Lesser General Public
  - License along with this library; if not, write to the Free Software
  - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - $Id: pom.xml 20565 2010-11-08 11:38:20Z benoitf $
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<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.ow2.jonas.assemblies</groupId>
    <artifactId>profiles</artifactId>
    <version>5.2.0-M3</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.ow2.jonas.assemblies.profiles</groupId>
  <artifactId>micro-jonas</artifactId>
  <packaging>pom</packaging>
  <name>JOnAS :: Assemblies :: Profiles :: Minimal</name>
  
  <build>
    <plugins>
      <plugin>
        <!-- Create the Micro JOnAS assembly -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <!-- Shared configuration for all executions -->
          <descriptors>
            <descriptor>src/main/assembly/assembly.xml</descriptor>
          </descriptors>
          <!-- Compatibility with older mvn-asmb-plg versions: append .dir to the directory name -->
          <ignoreDirFormatExtensions>false</ignoreDirFormatExtensions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <!-- Unpack the JOnAS configuration files + binaries -->
            <id>unpack-jonas-configuration</id>
            <goals>
              <goal>unpack</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.ow2.jonas.assemblies</groupId>
                  <artifactId>binaries</artifactId>
                  <version>${project.version}</version>
                </artifactItem>
                <artifactItem>
                  <groupId>org.ow2.jonas.assemblies</groupId>
                  <artifactId>configuration</artifactId>
                  <version>${project.version}</version>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/configuration-resources</outputDirectory>
              <excludes>META-INF/**</excludes>
            </configuration>
          </execution>
          <execution>
            <!-- JNDI Interceptors / Jetty / Tomcat / EasyBeans -->
            <id>unpack-extra-configuration-files</id>
            <goals>
              <goal>unpack</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.ow2.jonas</groupId>
                  <artifactId>jndi-interceptors</artifactId>
                  <classifier>config</classifier>
                  <version>${project.version}</version>
                </artifactItem>
                <artifactItem>
                  <groupId>org.ow2.jonas</groupId>
                  <artifactId>jonas-web-container-jetty-6.1</artifactId>
                  <version>${project.version}</version>
                </artifactItem>
                <artifactItem>
                  <groupId>org.ow2.jonas</groupId>
                  <artifactId>jonas-web-container-tomcat-6.0</artifactId>
                  <version>${project.version}</version>
                </artifactItem>
                <artifactItem>
                  <groupId>org.ow2.jonas</groupId>
                  <artifactId>jonas-web-container-tomcat-7.0</artifactId>
                  <version>${project.version}</version>
                </artifactItem>
                <artifactItem>
                  <groupId>org.ow2.jonas</groupId>
                  <artifactId>jonas-ejb-easybeans</artifactId>
                  <classifier>config</classifier>
                  <version>${project.version}</version>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/extra-resources</outputDirectory>
              <excludes>META-INF/**</excludes>
              <includes>jndi-interceptors.xml,tomcat6-*.xml, tomcat7-*.xml, jetty6*.xml,easybeans-jonas.xml</includes>
            </configuration>
          </execution>

          <execution>
            <!-- OSGi configuration files -->
            <id>unpack-osgi-configuration-files</id>
            <goals>
              <goal>unpack</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.ow2.jonas.launchers</groupId>
                  <artifactId>felix-launcher</artifactId>
                  <version>${project.version}</version>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/osgi-conf-resources</outputDirectory>
              <excludes>META-INF/**</excludes>
              <includes>
                org/ow2/jonas/**/gateway.properties,
                org/ow2/jonas/**/defaults.properties
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Before the assembly execution, place the bundles in the appropriate directory-->
        <groupId>org.ow2.util.maven</groupId>
        <artifactId>maven-jbuilding-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <profile>
            <include>depmonitor</include>
            <include>resourcemonitor</include>
            <include>wc</include>
          </profile>
        </configuration>
        <executions>
          <execution>
            <id>generate-jonas-services-maven2-deployment-plans</id>
            <goals>
              <goal>generate-maven2-deployment-plans</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <directory>repositories/url-internal</directory>
            </configuration>
          </execution>
          
          <execution>
            <id>copy-jonas-artifacts</id>
            <goals>
              <goal>assemble</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <directory>repositories/maven2-internal</directory>
            </configuration>
          </execution>
          
          <!-- Generate a version.properties in target/ -->
          <execution>
            <id>generate-versions-properties</id>
            <goals>
              <goal>versions</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <output>${project.build.directory}/assemble-resources/versions.properties</output>
            </configuration>
          </execution>
  
        </executions>
      </plugin>
      
      <!-- Set default JOnAS services for the micro-jonas profile -->
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <inherited>false</inherited>
        <executions>
          <execution>
            <id>set-minimal-services-list</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <replaceregexp file="${project.build.directory}/configuration-resources/conf/jonas.properties" match="jonas.services .*" replace="jonas.services    depmonitor" />

                <!--
                  The micro JOnAS profile doesn't have any deployable,
                  in particular it doesn't even have the jdbc-ds.xml datasource file
                  -->
                <delete>
                  <fileset dir="${project.build.directory}/configuration-resources/deploy" includes="**/*" />
                </delete>
              </tasks>
            </configuration>
          </execution>
          
          <execution>
            <id>move-osgi-configuration</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <copy toDir="${project.build.directory}/configuration-resources/conf/osgi">
                  <fileset dir="${project.build.directory}/osgi-conf-resources">
                    <include name="**/*.properties" />
                  </fileset>
                  <flattenmapper />
                </copy>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
