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

<!--
  Copyright oVirt Authors
  SPDX-License-Identifier: Apache-2.0
-->

<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>org.ovirt.engine.api</groupId>
  <artifactId>metamodel-parent</artifactId>
  <packaging>pom</packaging>
  <version>1.3.7</version>

  <name>oVirt API Metamodel Parent</name>

  <description>
    Model management tools for the oVirt Engine API.
  </description>

  <url>http://www.ovirt.org</url>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Juan Hernandez</name>
      <email>juan.hernandez@redhat.com</email>
      <organization>oVirt</organization>
      <organizationUrl>http://www.ovirt.org</organizationUrl>
    </developer>
    <developer>
      <name>Ori Liel</name>
      <email>oliel@redhat.com</email>
      <organization>oVirt</organization>
      <organizationUrl>http://www.ovirt.org</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://gerrit.ovirt.org/ovirt-engine-api-metamodel.git</connection>
    <developerConnection>scm:git:git://gerrit.ovirt.org/ovirt-engine-api-metamodel.git</developerConnection>
    <url>git://gerrit.ovirt.org/ovirt-engine-api-metamodel.git</url>
    <tag>1.3.7</tag>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <asciidoctor.version>1.6.0</asciidoctor.version>
    <antlr4.version>4.2.2</antlr4.version>
    <commons-cli.version>1.3.1</commons-cli.version>
    <commons-io.version>2.4</commons-io.version>
    <javax.activation.version>1.2.0</javax.activation.version>
    <javax.json.version>1.0.3</javax.json.version>
    <jaxb-api.version>2.3.0</jaxb-api.version>
    <jboss-jaxrs-api.version>1.0.0.Final</jboss-jaxrs-api.version>
    <jboss-servlet-api.version>1.0.0.Final</jboss-servlet-api.version>
    <junit.version>4.12</junit.version>
    <log4j.version>1.2.17</log4j.version>
    <qdox.version>2.0-M3</qdox.version>
    <slf4j.version>1.7.7</slf4j.version>
    <weld-se.version>2.3.0.Final</weld-se.version>
  </properties>

  <modules>
    <module>analyzer</module>
    <module>annotations</module>
    <module>concepts</module>
    <module>runtime</module>
    <module>server</module>
    <module>tests</module>
    <module>tool</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.sun.activation</groupId>
        <artifactId>javax.activation</artifactId>
        <version>${javax.activation.version}</version>
      </dependency>

      <!-- This is needed to process Java source files: -->
      <dependency>
        <groupId>com.thoughtworks.qdox</groupId>
        <artifactId>qdox</artifactId>
        <version>${qdox.version}</version>
      </dependency>

      <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>${commons-cli.version}</version>
      </dependency>

      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
      </dependency>

      <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>${jaxb-api.version}</version>
      </dependency>

      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
      </dependency>

      <!-- This is needed by the constraint parser: -->
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>${antlr4.version}</version>
      </dependency>

      <!-- This is needed in order to generate HTML code from the model documentation: -->
      <dependency>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctorj</artifactId>
        <version>${asciidoctor.version}</version>
      </dependency>

      <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.json</artifactId>
        <version>${javax.json.version}</version>
      </dependency>

      <dependency>
        <groupId>org.jboss.spec.javax.servlet</groupId>
        <artifactId>jboss-servlet-api_3.1_spec</artifactId>
        <version>${jboss-servlet-api.version}</version>
      </dependency>

      <dependency>
        <groupId>org.jboss.spec.javax.ws.rs</groupId>
        <artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
        <version>${jboss-jaxrs-api.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

    <!-- The tool runs in a CDI environment, implemented by Weld: -->
    <dependency>
      <groupId>org.jboss.weld.se</groupId>
      <artifactId>weld-se</artifactId>
      <version>${weld-se.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>

        <!-- Make sure we use Java 11. -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
            <source>11</source>
            <target>11</target>
            <release>11</release>
          </configuration>
        </plugin>

        <!-- Attach sources during the package phase, so that if there is
             generated source code it will be included as well. -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>

      <!-- Create and attach JBoss modules, for all child projects: -->
      <plugin>
        <groupId>org.ovirt.maven.plugins</groupId>
        <artifactId>ovirt-jboss-modules-maven-plugin</artifactId>
        <version>2.0.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>attach-modules</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <category>common</category>
        </configuration>
      </plugin>

      <!-- Run spotbugs in all the projects with a explicit list
           of exclussions: -->

      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>3.1.12</version>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <xmlOutputDirectory>target/site</xmlOutputDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</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>
        <configuration>
          <source>11</source>
          <target>11</target>
          <release>11</release>
	  <doclint>none</doclint>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.2</version>
        <configuration>
          <tagNameFormat>@{version}</tagNameFormat>
          <pushChanges>false</pushChanges>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <profile>
      <id>sign</id>
      <build>
        <plugins>
          <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>
        </plugins>
      </build>
    </profile>

  </profiles>

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

</project>
