<!--
  ~ JBoss, a division of Red Hat
  ~ Copyright 2011, Red Hat Middleware, LLC, and individual
  ~ contributors as indicated by the @authors tag. See the
  ~ copyright.txt in the distribution for a full listing of
  ~ individual contributors.
  ~
  ~ This 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 software 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 software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->

<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.exoplatform.gatein.pc</groupId>
      <artifactId>pc-parent</artifactId>
      <version>7.0.0-M04</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>pc-api</artifactId>
   <packaging>jar</packaging>
   <name>GateIn - Portlet Container (api)</name>

  <properties>
    <exo.test.coverage.ratio>0.11</exo.test.coverage.ratio>
    <maven.javadoc.skip>true</maven.javadoc.skip>
  </properties>

   <dependencies>
       <dependency>
           <groupId>org.gatein.common</groupId>
           <artifactId>common-common</artifactId>
       </dependency>
       <dependency>
           <groupId>org.slf4j</groupId>
           <artifactId>slf4j-api</artifactId>
       </dependency>
       <dependency>
           <groupId>javax.xml.bind</groupId>
           <artifactId>jaxb-api</artifactId>
       </dependency>
       <dependency>
         <groupId>jakarta.servlet</groupId>
         <artifactId>jakarta.servlet-api</artifactId>
         <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>javax.portlet</groupId>
         <artifactId>portlet-api</artifactId>
         <classifier>sources</classifier>
       </dependency>
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <scope>test</scope>
      </dependency>
       <dependency>
           <groupId>org.exoplatform.kernel</groupId>
           <artifactId>exo.kernel.commons</artifactId>
       </dependency>
   </dependencies>

  <build>
    <finalName>${project.artifactId}</finalName>
    <resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>target/portlet-api</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/java</directory>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <encoding>ISO-8859-1</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>javax.portlet</groupId>
                  <artifactId>portlet-api</artifactId>
                  <classifier>sources</classifier>
                  <overWrite>false</overWrite>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/portlet-api</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/portlet-api</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-patch-plugin</artifactId>
        <version>1.2</version>
        <configuration>
          <targetDirectory>${project.build.directory}</targetDirectory>
        </configuration>
        <executions>
          <execution>
            <id>javax.servlet-patch</id>
            <configuration>
              <patchFile>${basedir}/src/main/patches/javax.servlet.patch</patchFile>
              <patchTrackingFile>${project.build.directory}/javax.servlet-patches-applied.txt</patchTrackingFile>
            </configuration>
            <phase>process-resources</phase>
            <goals>
              <goal>apply</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
