<?xml version="1.0" encoding="UTF-8"?>
<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>
  <groupId>pt.ulisboa</groupId>
  <artifactId>ewp-connector-api</artifactId>
  <version>3.16.0</version>
  <packaging>jar</packaging>

  <name>EWP Connector API</name>
  <description>Generated API data classes for EWP network.</description>
  <url>https://github.com/ULisboa/ewp-connector-api</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>ULisboa Development Team</name>
      <email>desenvolvimento.di@reitoria.ulisboa.pt</email>
      <organization>University of Lisbon</organization>
      <organizationUrl>https://www.ulisboa.pt/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:ULisboa/ewp-connector-api.git</connection>
    <developerConnection>scm:git:git@github.com:ULisboa/ewp-connector-api.git</developerConnection>
    <url>http://github.com/ULisboa/ewp-connector-api/tree/master</url>
    <tag>3.16.0</tag>
  </scm>

  <properties>
    <java.version>1.11</java.version>

    <jaxb2.version>2.5.0</jaxb2.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.1</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <!-- We use this plugin to ensure that our usage of the
        maven-jaxb2-plugin is JDK 8 compatible in absence of a fix
        for jaxb2-maven-plugin. -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <version>1.0.0</version>
        <executions>
          <execution>
            <id>set-additional-system-properties</id>
            <goals>
              <goal>set-system-properties</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <properties>
            <property>
              <name>javax.xml.accessExternalDTD</name>
              <value>all</value>
            </property>
            <property>
              <name>javax.xml.accessExternalSchema</name>
              <value>all</value>
            </property>
          </properties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.jvnet.jaxb</groupId>
        <artifactId>jaxb-maven-plugin</artifactId>
        <version>2.0.9</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <extension>true</extension>
              <args>
                <arg>-Xannotate</arg>
              </args>
              <catalog>src/main/resources/schemas/__index__.xml</catalog>
              <strict>false</strict>
              <schemaDirectory>src/main/resources/schemas/</schemaDirectory>
              <schemaIncludes>
                <include>ewp.xsd</include>
              </schemaIncludes>
              <bindingDirectory>src/main/resources/xjb/</bindingDirectory>
              <plugins>
                <plugin>
                  <groupId>org.jvnet.jaxb</groupId>
                  <artifactId>jaxb-basics-annotate</artifactId>
                  <version>2.0.9</version>
                </plugin>
                <plugin>
                  <groupId>org.jvnet.jaxb</groupId>
                  <artifactId>jaxb-annox</artifactId>
                  <version>2.0.9</version>
                </plugin>
                <plugin>
                  <groupId>org.jvnet.jaxb</groupId>
                  <artifactId>jaxb2-basics</artifactId>
                  <version>2.0.9</version>
                </plugin>
              </plugins>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
          <release>11</release>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <releaseProfiles>release</releaseProfiles>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>

      <plugin>
        <groupId>se.bjurr.gitchangelog</groupId>
        <artifactId>git-changelog-maven-plugin</artifactId>
        <version>1.95.2</version>
        <executions>
          <execution>
            <id>GenerateGitChangelog</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>git-changelog</goal>
            </goals>
            <configuration>
              <templateContent>
# Changelog

{{#tags}}
{{#ifReleaseTag .}}
## [{{name}}](https://github.com/{{ownerName}}/{{repoName}}/tree/{{name}}) ({{tagDate .}})

{{#ifContainsType commits type='feat'}}
### Features
{{#commits}}
{{#ifCommitType . type='feat'}}
- {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hashFull}}))
{{/ifCommitType}}
{{/commits}}
{{/ifContainsType}}

{{#ifContainsType commits type='improvement'}}
### Improvements
{{#commits}}
{{#ifCommitType . type='improvement'}}
- {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hashFull}}))
{{/ifCommitType}}
{{/commits}}
{{/ifContainsType}}

{{#ifContainsType commits type='fix'}}
### Bug Fixes
{{#commits}}
{{#ifCommitType . type='fix'}}
- {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hashFull}}))
{{/ifCommitType}}
{{/commits}}
{{/ifContainsType}}

{{#ifContainsType commits type='refactor'}}
### Refactor
{{#commits}}
{{#ifCommitType . type='refactor'}}
- {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hashFull}}))
{{/ifCommitType}}
{{/commits}}
{{/ifContainsType}}

{{/ifReleaseTag}}
{{/tags}}
              </templateContent>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <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>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

</project>
