<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2021 PubCOI.org
  ~
  ~ This program 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 3 of the License, or (at your option) any later version.
  ~
  ~ This program 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; if not, write to the Free Software Foundation,
  ~ Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  -->

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.pubcoi.fos</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.2</version>
    </parent>

    <artifactId>fos-cdm</artifactId>
    <version>1.0.3</version>

    <name>fos-cdm</name>
    <url>https://github.com/PubCOI/fos-cdm</url>
    <description>Common Data Model for Fos-related services</description>

    <scm>
        <connection>scm:git:git@github.com:PubCOI/fos-cdm.git</connection>
        <developerConnection>scm:git:git@github.com:PubCOI/fos-cdm.git</developerConnection>
        <url>https://github.com/PubCOI/fos-cdm</url>
      <tag>fos-cdm-1.0.3</tag>
  </scm>

    <licenses>
        <license>
            <name>GNU Lesser General Public License v3.0 or later</name>
            <url>https://www.gnu.org/licenses/lgpl-3.0-standalone.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>rmacd</id>
            <name>Ronald MacDonald</name>
            <email>ronald@rmacd.com</email>
            <roles>
                <role>developer</role>
                <role>project-administrator</role>
            </roles>
            <timezone>+00:00</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxb-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pubcoi.schemas</groupId>
            <artifactId>hmg-contracts-finder</artifactId>
            <version>1.0.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.addicticks.oss</groupId>
            <artifactId>jtexttime</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-mongodb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-runtime</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDuplicatePomDependencyVersions />
                                <dependencyConvergence />
                                <requireMavenVersion>
                                    <version>[3.5,)</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <!-- Library must be built with 1.8 so that it can be   -->
                                    <!-- imported / used by those still on 1.8:             -->
                                    <!-- export JAVA_HOME=`/usr/libexec/java_home -v 1.8`   -->
                                    <version>[1.8,1.9)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-fluent-api</artifactId>
                        <version>${version.jaxb2-fluent-api}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework.data</groupId>
                        <artifactId>spring-data-mongodb</artifactId>
                        <version>${version.spring-data-mongodb}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <forceRegenerate>true</forceRegenerate>
                    <extension>true</extension>
                    <removeOldOutput>false</removeOldOutput>
                    <schemaDirectory>src/main/xsd</schemaDirectory>
                    <bindingDirectory>src/main/xjb</bindingDirectory>
                    <verbose>true</verbose>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-attachment</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <args>
                                <arg>-Xfluent-api</arg>
                                <arg>-Xannotate</arg>
                                <arg>-XtoString</arg>
                                <arg>-XhashCode</arg>
                                <arg>-Xequals</arg>
                            </args>
                            <schemaIncludes>
                                <schemaInclude>**/ContractAttachment.xsd</schemaInclude>
                            </schemaIncludes>
                            <bindingIncludes>
                                <bindingInclude>**/global.xjb</bindingInclude>
                                <bindingInclude>**/attachment.xjb</bindingInclude>
                            </bindingIncludes>
                            <plugins>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-basics</artifactId>
                                    <version>${version.jaxb2-basics}</version>
                                </plugin>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-basics-annotate</artifactId>
                                    <version>${version.jaxb2-basics-annotate}</version>
                                </plugin>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-fluent-api</artifactId>
                                    <version>${version.jaxb2-fluent-api}</version>
                                </plugin>
                            </plugins>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generate-batch-job</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <args>
                                <arg>-Xfluent-api</arg>
                                <arg>-Xannotate</arg>
                            </args>
                            <schemaIncludes>
                                <schemaInclude>**/BatchJob.xsd</schemaInclude>
                            </schemaIncludes>
                            <bindingIncludes>
                                <bindingInclude>**/global.xjb</bindingInclude>
                                <bindingInclude>**/batch-job.xjb</bindingInclude>
                            </bindingIncludes>
                            <plugins>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-basics</artifactId>
                                    <version>${version.jaxb2-basics}</version>
                                </plugin>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-basics-annotate</artifactId>
                                    <version>${version.jaxb2-basics-annotate}</version>
                                </plugin>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-fluent-api</artifactId>
                                    <version>${version.jaxb2-fluent-api}</version>
                                </plugin>
                            </plugins>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>info@pubcoi.org</keyname>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
