<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- $Rev: 600338 $ $Date: 2007-12-02 09:08:04 -0800 (Sun, 02 Dec 2007) $ -->

<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>
    <artifactId>tomee</artifactId>
    <groupId>org.apache.openejb</groupId>
    <version>1.5.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>apache-tomee</artifactId>
  <packaging>pom</packaging>
  <name>OpenEJB :: TomEE :: Apache TomEE</name>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>jline</groupId>
      <artifactId>jline</artifactId>
      <version>0.9.94</version>
    </dependency>
    <dependency>
      <artifactId>commons-lang3</artifactId>
      <groupId>org.apache.commons</groupId>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-core</artifactId>
      <version>${openejb.version}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>tomcat</artifactId>
      <version>${tomcat.version}</version>
      <type>zip</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-nodeps</artifactId>
      <version>1.7.1</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>tomee-common</artifactId>
      <version>${tomee.version}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency> <!-- to be sure to have it -->
      <groupId>org.apache.openejb</groupId>
      <artifactId>tomee-plus-webapp</artifactId>
      <version>${tomee.version}</version>
      <type>war</type>
      <scope>provided</scope>
    </dependency>
    <dependency> <!-- to be sure to have it -->
      <groupId>org.apache.openejb</groupId>
      <artifactId>tomee-jaxrs-webapp</artifactId>
      <version>${tomee.version}</version>
      <type>war</type>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <excludes>
          <exclude>**/*.exe</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
        <includes>
          <include>**/*.exe</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.5</version>
        <executions>
          <execution>
            <id>filter-resources</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <id>copy-tomcat-for-webprofile</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.tomcat</groupId>
                  <artifactId>tomcat</artifactId>
                  <version>${tomcat.version}</version>
                  <type>zip</type>
                  <outputDirectory>${webprofile.work-dir}</outputDirectory>
                  <destFileName>apache-tomcat-${tomcat.version}.zip</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>copy-tomcat-for-jaxrs</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.tomcat</groupId>
                  <artifactId>tomcat</artifactId>
                  <version>${tomcat.version}</version>
                  <type>zip</type>
                  <outputDirectory>${jaxrs.work-dir}</outputDirectory>
                  <destFileName>apache-tomcat-${tomcat.version}.zip</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>copy-tomcat-for-plus</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.tomcat</groupId>
                  <artifactId>tomcat</artifactId>
                  <version>${tomcat.version}</version>
                  <type>zip</type>
                  <outputDirectory>${plus.work-dir}</outputDirectory>
                  <destFileName>apache-tomcat-${tomcat.version}.zip</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>1.3</version>
        <configuration>
          <scriptpath>
            <element>${project.basedir}/src/main/groovy</element>
          </scriptpath>
          <classpath>
            <element>
              <groupId>jline</groupId>
              <artifactId>jline</artifactId>
              <version>0.9.94</version>
            </element>
            <element>
              <groupId>org.apache.ant</groupId>
              <artifactId>ant-nodeps</artifactId>
              <version>1.7.1</version>
              <type>jar</type>
            </element>
          </classpath>
          <defaults>
            <testSectionsFile>${project.basedir}/sections.properties</testSectionsFile>
            <logOutputDirectory>${project.build.directory}/logs</logOutputDirectory>
            <backupLogs>true</backupLogs>
          </defaults>
        </configuration>
        <executions>
          <execution>
            <id>execute-web-profile-installer</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>new commands.SetupCommand(this).execute()</source>
              <properties>
                <tomee.workdir>${webprofile.work-dir}</tomee.workdir>
                <tomee.webapp>tomee-webapp</tomee.webapp>
              </properties>
              <classpath>
                <element>
                  <groupId>jline</groupId>
                  <artifactId>jline</artifactId>
                  <version>0.9.94</version>
                </element>
                <element>
                  <groupId>org.apache.ant</groupId>
                  <artifactId>ant-nodeps</artifactId>
                  <version>1.7.1</version>
                  <type>jar</type>
                </element>
              </classpath>
            </configuration>
          </execution>
          <execution>
            <id>execute-jaxrs-installer</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>new commands.SetupCommand(this).execute()</source>
              <properties>
                <tomee.workdir>${jaxrs.work-dir}</tomee.workdir>
                <tomee.webapp>tomee-jaxrs-webapp</tomee.webapp>
              </properties>
              <classpath>
                <element>
                  <groupId>jline</groupId>
                  <artifactId>jline</artifactId>
                  <version>0.9.94</version>
                </element>
                <element>
                  <groupId>org.apache.ant</groupId>
                  <artifactId>ant-nodeps</artifactId>
                  <version>1.7.1</version>
                  <type>jar</type>
                </element>
              </classpath>
            </configuration>
          </execution>
          <execution>
            <id>execute-plus-installer</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>new commands.SetupCommand(this).execute()</source>
              <properties>
                <tomee.workdir>${plus.work-dir}</tomee.workdir>
                <tomee.webapp>tomee-plus-webapp</tomee.webapp>
              </properties>
              <classpath>
                <element>
                  <groupId>jline</groupId>
                  <artifactId>jline</artifactId>
                  <version>0.9.94</version>
                </element>
                <element>
                  <groupId>org.apache.ant</groupId>
                  <artifactId>ant-nodeps</artifactId>
                  <version>1.7.1</version>
                  <type>jar</type>
                </element>
              </classpath>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2.2</version>
        <executions>
          <execution>
            <id>webprofile</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/tomee-webprofile.xml</descriptor>
              </descriptors>
              <attach>false</attach>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>apache-tomee-webprofile-${project.version}</finalName>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
          <execution>
            <id>jaxrs</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/tomee-jaxrs.xml</descriptor>
              </descriptors>
              <attach>false</attach>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>apache-tomee-jaxrs-${project.version}</finalName>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
          <execution>
            <id>plus</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/tomee-plus.xml</descriptor>
              </descriptors>
              <attach>false</attach>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>apache-tomee-plus-${project.version}</finalName>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/apache-tomee-webprofile-${project.version}.zip</file>
                  <type>zip</type>
                  <classifier>webprofile</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/apache-tomee-webprofile-${project.version}.tar.gz</file>
                  <type>tar.gz</type>
                  <classifier>webprofile</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/apache-tomee-jaxrs-${project.version}.zip</file>
                  <type>zip</type>
                  <classifier>jaxrs</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/apache-tomee-jaxrs-${project.version}.tar.gz</file>
                  <type>tar.gz</type>
                  <classifier>jaxrs</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/apache-tomee-plus-${project.version}.zip</file>
                  <type>zip</type>
                  <classifier>plus</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/apache-tomee-plus-${project.version}.tar.gz</file>
                  <type>tar.gz</type>
                  <classifier>plus</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <properties>
    <localRepository>${settings.localRepository}</localRepository>
    <http.proxy.host>${settings.activeProxy.host}</http.proxy.host>
    <http.proxy.port>${settings.activeProxy.port}</http.proxy.port>
    <http.proxy.username>${settings.activeProxy.username}</http.proxy.username>
    <http.proxy.password>${settings.activeProxy.password}</http.proxy.password>
    <http.proxy.nonProxyHosts>${settings.activeProxy.nonProxyHosts}</http.proxy.nonProxyHosts>

    <webprofile.work-dir>${project.build.directory}/webprofile-work-dir</webprofile.work-dir>
    <plus.work-dir>${project.build.directory}/plus-work-dir</plus.work-dir>
    <jaxrs.work-dir>${project.build.directory}/jaxrs-work-dir</jaxrs.work-dir>
  </properties>

</project>

