<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2013-2020 Linagora

 This program/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 program/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 program/library; If not, see http://www.gnu.org/licenses/
 for the GNU Lesser General Public License version 2.1.
-->
<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>
      <artifactId>petals-parent</artifactId>
      <groupId>org.ow2.petals</groupId>
      <relativePath />
      <version>20.2.8.2</version>
   </parent>

   <name>Petals ESB - Components - Parent</name>
   <groupId>org.ow2.petals</groupId>
   <artifactId>petals-components-parent</artifactId>
   <packaging>pom</packaging>
   <version>1.1.0.2</version>
   <description>JBI Components for Petals ESB</description>

   <properties>
      <jbi-component.build.legal-dir>${project.build.directory}/legal-additionals</jbi-component.build.legal-dir>
   </properties>

   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>org.ow2.petals</groupId>
            <artifactId>petals-jbi</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>1.4.0</version>
         </dependency>
         <dependency>
            <groupId>org.ow2.petals</groupId>
            <artifactId>petals-commons-log</artifactId>
      	    <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>1.1.0</version>
         </dependency>
         <dependency>
            <groupId>org.ow2.petals</groupId>
            <artifactId>petals-jbi-ext</artifactId>
             <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>1.4.0</version>
         </dependency>
         <dependency>
            <groupId>org.ow2.petals</groupId>
            <artifactId>petals-log</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>1.2.0</version>
         </dependency>
         <dependency>
            <groupId>org.ow2.easycommons</groupId>
            <artifactId>easycommons-io</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${easycommons-io.version}</version>
         </dependency>
         <dependency>
            <groupId>org.ow2.easycommons</groupId>
            <artifactId>easycommons-lang</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${easycommons-lang.version}</version>
         </dependency>
         <dependency>
            <groupId>org.ow2.easycommons</groupId>
            <artifactId>easycommons-properties</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${easycommons-properties.version}</version>
         </dependency>
         <dependency>
            <groupId>org.ow2.easycommons</groupId>
            <artifactId>easycommons-uuid</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${easycommons-uuid.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${commons-pool.version}</version>
         </dependency>
         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${slf4j.version}</version>
         </dependency>
         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${slf4j.version}</version>
         </dependency>
         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${slf4j.version}</version>
         </dependency>
         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <!-- Provided by petals-bootstrap-launcher -->
            <scope>provided</scope>
            <version>${slf4j.version}</version>
         </dependency>
      </dependencies>
   </dependencyManagement>

   <build>
      <pluginManagement>
         <plugins>
            <plugin>
               <!--
                  Disable the source ZIP assembly coming from the OW2 parent POM
                  because it override the JBI archive. When a classifier 'sources'
                  will be used at OW2 parent POM to suffixe the ZIP file, the assembly
                  will be to re-enable.
               -->
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-assembly-plugin</artifactId>
               <executions>
                  <execution>
                     <id>source-release-assembly</id>
                     <configuration>
                        <skipAssembly>true</skipAssembly>
                     </configuration>
                  </execution>
               </executions>
            </plugin>
         </plugins>
      </pluginManagement>
      <plugins>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
               <execution>
                  <id>download-licenses</id>
                  <!--
                     We override the phase of the goal 'download-licenses' to be able to add legal information
                     into our JBI components
                  -->
                  <phase>prepare-package</phase>
                  <goals>
                     <goal>download-licenses</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
               <execution>
                  <phase>prepare-package</phase>
                  <goals>
                     <goal>run</goal>
                  </goals>
                  <configuration>
                     <tasks>
                        <!-- All legal information are put in the directory META-INF of the JBI component archive -->
                        <copy file="${basedir}/LICENSE" todir="${jbi-component.build.legal-dir}/META-INF/legal" />
                        <copy file="${basedir}/COPYRIGHT" todir="${jbi-component.build.legal-dir}/META-INF/legal" />
                        <copy file="${project.build.directory}/generated-sources/license/THIRD-PARTY" todir="${jbi-component.build.legal-dir}/META-INF/legal" />
                        <copy todir="${jbi-component.build.legal-dir}/META-INF/legal/licenses">
                           <fileset dir="${project.build.directory}/generated-resources/licenses" />
                        </copy>
                     </tasks>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.ow2.petals</groupId>
            <artifactId>petals-maven-plugin</artifactId>
            <version>3.1.0</version>
            <extensions>true</extensions>
            <configuration>
               <jbiDirectory>src/main/resources/jbi</jbiDirectory>
               <attachJar>true</attachJar>
               <!-- Our JBI components include legal information -->
               <additionalJBIResourceDirectory>${jbi-component.build.legal-dir}</additionalJBIResourceDirectory>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <scm>
      <connection>scm:svn:https://svn.petalslink.org/svnroot/tags/petals-components-parent-1.1.0.2</connection>
      <developerConnection>scm:svn:https://svn.petalslink.org/svnroot/tags/petals-components-parent-1.1.0.2</developerConnection>
      <url>scm:svn:https://svn.petalslink.org/svnroot/tags/petals-components-parent-1.1.0.2</url>
   </scm>
</project>
