<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2015 herd contributors

  Licensed 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>
      <groupId>org.finra.herd</groupId>
      <artifactId>herd-code</artifactId>
      <version>0.80.0</version>
   </parent>

   <name>herd model api</name>

   <!-- groupId and version are inherited from the parent and can be overridden here if needed. -->
   <artifactId>herd-model-api</artifactId>

   <description>This project contains the model API classes. This contains the herd XSD and generates Java POJO's from them. These classes are used for incoming
      and outgoing calls into the system (e.g. via REST).
   </description>
   <url>http://finraos.github.io/herd/</url>

   <dependencies>

      <dependency>
         <groupId>org.jvnet.jaxb2_commons</groupId>
         <artifactId>jaxb2-basics-runtime</artifactId>
      </dependency>
      <dependency>
         <groupId>org.eclipse.persistence</groupId>
         <artifactId>org.eclipse.persistence.moxy</artifactId>
      </dependency>

   </dependencies>

   <build>

      <plugins>

         <!-- Use the maven-jaxb2-plugin to auto-generate our Java model classes from the XSD and XJB resources. -->
         <plugin>
            <!--
            This Maven 2 plugin wraps the JAXB 2.x XJC compiler and provides the capability to generate Java sources from XML Schemas.
            General instructions on how to use the Maven JAXB2 plugin can be found here:
            http://confluence.highsource.org/display/MJIIP/Maven+JAXB2+Plugin
            -->
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <executions>
               <execution>
                  <id>herd-jaxb-generate</id>
                  <phase>generate-sources</phase>
                  <goals>
                     <goal>generate</goal>
                  </goals>
                  <configuration>
                     <schemaDirectory>src/main/resources</schemaDirectory>
                     <generatePackage>org.finra.herd.model.api.xml</generatePackage>
                     <generateDirectory>${project.build.directory}/generated-sources/jaxb/herd</generateDirectory>
                  </configuration>
               </execution>
            </executions>
            <configuration>
               <extension>true</extension>
               <args>
                  <arg>-no-header</arg>
                  <arg>-Xxew</arg>
                  <arg>-Xxew:instantiate none</arg>
                  <arg>-Xvalue-constructor</arg>
                  <arg>-XtoString</arg>
                  <arg>-Xequals</arg>
                  <arg>-XhashCode</arg>
                  <arg>-Xcopyable</arg>
                  <arg>-Xannotate</arg>
               </args>
               <plugins>
                  <plugin>
                     <!--
                     This JAXB plugin utilises the power of  @XmlElementWrapper  annotation.
                     Originally  xjc  trends to create wrapper classes which are the containers for collections.
                     This plugin goes through all properties to find ones which can be represented in the model in more optimal way.
                     General instructions on how to use the JAXB plugin can be found here: https://github.com/dmak/jaxb-xew-plugin
                     -->
                     <groupId>com.github.jaxb-xew-plugin</groupId>
                     <artifactId>jaxb-xew-plugin</artifactId>
                     <!-- TODO: Please investigate if we can remove the below plugin version. -->
                     <version>${jaxb.xew.plugin.version}</version>
                  </plugin>
                  <plugin>
                     <groupId>org.jvnet.jaxb2_commons</groupId>
                     <artifactId>jaxb2-basics-annotate</artifactId>
                     <!-- TODO: Please investigate if we can remove the below plugin version. -->
                     <version>${jaxb2.basics.annotate.version}</version>
                  </plugin>
                  <plugin>
                     <!-- JAXB2 Basics Basic Plugins -->
                     <groupId>org.jvnet.jaxb2_commons</groupId>
                     <artifactId>jaxb2-basics</artifactId>
                     <!-- TODO: Please investigate if we can remove the below plugin version. -->
                     <version>${jaxb2.basics.version}</version>
                  </plugin>
                  <plugin>
                     <!-- JAXB2 Basics Tools -->
                     <groupId>org.jvnet.jaxb2_commons</groupId>
                     <artifactId>jaxb2-basics-tools</artifactId>
                     <!-- TODO: Please investigate if we can remove the below plugin version. -->
                     <version>${jaxb2.basics.tools.version}</version>
                  </plugin>
                  <plugin>
                     <!-- JAXB2 Value Constructor -->
                     <groupId>org.jvnet.jaxb2_commons</groupId>
                     <artifactId>jaxb2-value-constructor</artifactId>
                     <!-- TODO: Please investigate if we can remove the below plugin version. -->
                     <version>${jaxb2.value.constructor.version}</version>
                  </plugin>
               </plugins>
            </configuration>
            <dependencies>
               <dependency>
                  <groupId>org.eclipse.persistence</groupId>
                  <artifactId>org.eclipse.persistence.moxy</artifactId>
                  <!-- TODO: Please investigate if we can remove the below version. -->
                  <version>${eclipse.persistence.version}</version>
               </dependency>
            </dependencies>
         </plugin>
      </plugins>

   </build>

</project>
