<?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>

   <parent>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-parent</artifactId>
      <version>39</version>
      <relativePath/>
   </parent>

   <groupId>org.infinispan.protostream</groupId>
   <artifactId>parent</artifactId>
   <version>4.4.5.Final</version>
   <packaging>pom</packaging>

   <name>ProtoStream - parent</name>
   <description>Parent for all ProtoStream modules</description>
   <url>https://infinispan.org</url>

   <organization>
      <name>JBoss, a division of Red Hat</name>
      <url>http://www.jboss.org</url>
   </organization>

   <licenses>
      <license>
         <name>Apache License 2.0</name>
         <url>https://apache.org/licenses/LICENSE-2.0</url>
         <distribution>repo</distribution>
      </license>
   </licenses>

   <developers>
      <developer>
         <id>placeholder</id>
         <name>See https://infinispan.org for a complete list of contributors</name>
      </developer>
   </developers>

   <scm>
      <connection>scm:git:git@github.com:infinispan/protostream.git</connection>
      <developerConnection>scm:git:git@github.com:infinispan/protostream.git</developerConnection>
      <url>https://github.com/infinispan/protostream</url>
   </scm>

   <issueManagement>
      <system>github</system>
      <url>https://github.com/infinispan/protostream/issues</url>
   </issueManagement>

   <ciManagement>
      <system>github</system>
      <url>https://github.com/infinispan/protostream/actions</url>
   </ciManagement>

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

      <!-- overwrite plugins version from jboss-parent -->
      <maven.compiler.target>1.8</maven.compiler.target>
      <maven.compiler.source>1.8</maven.compiler.source>
      <version.compiler.plugin>3.14.0</version.compiler.plugin>
      <version.jar.plugin>3.2.0</version.jar.plugin>
      <version.javadoc.plugin>3.3.1</version.javadoc.plugin>
      <version.source.plugin>3.2.0</version.source.plugin>
      <version.antrun.plugin>3.0.0</version.antrun.plugin>
      <version.surefire.plugin>3.0.0-M5</version.surefire.plugin>
      <version.shade.plugin>3.2.4</version.shade.plugin>
      <version.maven.sonatype.central>0.8.0</version.maven.sonatype.central>

      <!-- plugins version -->
      <version.maven.gpg>3.2.8</version.maven.gpg>

      <version.protobuf>3.25.8</version.protobuf>
      <version.javax.annotation-api>1.3.2</version.javax.annotation-api>
      <version.junit>4.13.1</version.junit>
      <version.compile-testing>0.19</version.compile-testing>
      <version.mockito>4.3.1</version.mockito>
      <version.jcipannotations>1.0</version.jcipannotations>
      <version.fest.assertions>2.0M10</version.fest.assertions>
      <version.protoparser>4.0.3</version.protoparser>
      <version.jboss.logging>3.4.3.Final</version.jboss.logging>
      <version.jboss.logging.annotations>2.2.1.Final</version.jboss.logging.annotations>
      <version.jboss.logging.processor>2.2.1.Final</version.jboss.logging.processor>
      <version.log4j>2.17.2</version.log4j>
      <version.jboss.marshalling>2.0.12.Final</version.jboss.marshalling>
      <version.javassist>3.28.0-GA</version.javassist>
      <version.commons-cli>1.5.0</version.commons-cli>
      <version.jackson>2.15.0</version.jackson>
      <version.auto-service>1.1.1</version.auto-service>
   </properties>

   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>protostream</artifactId>
            <version>${project.version}</version>
         </dependency>

         <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>sample-domain-definition</artifactId>
            <version>${project.version}</version>
         </dependency>

         <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>protostream-processor</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
         </dependency>

         <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>protostream-processor</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${version.log4j}</version>
            <scope>provided</scope>
         </dependency>

         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${version.log4j}</version>
            <scope>provided</scope>
         </dependency>

         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${version.log4j}</version>
            <scope>provided</scope>
         </dependency>

         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jul</artifactId>
            <version>${version.log4j}</version>
            <scope>provided</scope>
         </dependency>

         <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>${version.jboss.logging}</version>
         </dependency>

         <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-annotations</artifactId>
            <version>${version.jboss.logging.annotations}</version>
            <scope>provided</scope>
            <optional>true</optional>
         </dependency>

         <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-processor</artifactId>
            <version>${version.jboss.logging.processor}</version>
            <scope>provided</scope>
            <optional>true</optional>
         </dependency>

         <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>${version.javax.annotation-api}</version>
            <scope>provided</scope>
         </dependency>

         <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${version.protobuf}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>com.squareup</groupId>
            <artifactId>protoparser</artifactId>
            <version>${version.protoparser}</version>
            <optional>true</optional>
         </dependency>

         <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>${version.javassist}</version>
            <optional>true</optional>
         </dependency>

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

         <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${version.jackson}</version>
            <optional>true</optional>
         </dependency>

         <dependency>
            <groupId>com.google.auto.service</groupId>
            <artifactId>auto-service</artifactId>
            <version>${version.auto-service}</version>
            <scope>provided</scope>
            <optional>true</optional>
         </dependency>

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

         <dependency>
            <groupId>com.google.testing.compile</groupId>
            <artifactId>compile-testing</artifactId>
            <version>0.23.0</version>
         </dependency>

         <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${version.mockito}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
            <version>${version.jcipannotations}</version>
            <scope>provided</scope>
            <optional>true</optional>
         </dependency>

         <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert-core</artifactId>
            <version>${version.fest.assertions}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>org.jboss.marshalling</groupId>
            <artifactId>jboss-marshalling</artifactId>
            <version>${version.jboss.marshalling}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>org.jboss.marshalling</groupId>
            <artifactId>jboss-marshalling-river</artifactId>
            <version>${version.jboss.marshalling}</version>
            <scope>test</scope>
         </dependency>
      </dependencies>
   </dependencyManagement>

   <build>
      <pluginManagement>
         <plugins>
            <plugin>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration combine.self="append">
                  <encoding>UTF-8</encoding>
                  <!-- both maven and javac are buggy regarding handling of APs with incremental compilation -->
                  <useIncrementalCompilation>false</useIncrementalCompilation>
                  <!-- Include method parameter debug info -->
                  <parameters>true</parameters>
                  <release>8</release>
               </configuration>
            </plugin>

            <plugin>
               <groupId>org.sonatype.central</groupId>
               <artifactId>central-publishing-maven-plugin</artifactId>
               <version>${version.maven.sonatype.central}</version>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-report-plugin</artifactId>
               <version>${version.surefire.plugin}</version>
               <executions>
                  <execution>
                     <phase>verify</phase>
                     <goals>
                        <goal>report</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-gpg-plugin</artifactId>
               <version>${version.maven.gpg}</version>
               <executions>
                  <execution>
                     <id>sign-artifacts</id>
                     <phase>verify</phase>
                     <goals>
                        <goal>sign</goal>
                     </goals>
                     <configuration>
                        <passphraseServerId>gpg.passphrase</passphraseServerId>
                        <gpgArguments>
                           <arg>--pinentry-mode</arg>
                           <arg>loopback</arg>
                        </gpgArguments>
                     </configuration>
                  </execution>
               </executions>
            </plugin>
         </plugins>
      </pluginManagement>

      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
               <execution>
                  <id>javadoc</id>
                  <phase>package</phase>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <source>8</source>
               <doclint>none</doclint>
               <detectLinks>false</detectLinks>
               <detectOfflineLinks>false</detectOfflineLinks>
               <links>
                  <link>http://docs.oracle.com/javase/8/docs/api/</link>
               </links>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
               <execution>
                  <id>enforce-java</id>
                  <goals>
                     <goal>enforce</goal>
                  </goals>
                  <configuration>
                     <rules>
                        <requireJavaVersion>
                           <version>[${maven.compiler.source},)</version>
                        </requireJavaVersion>
                        <requireMavenVersion>
                           <version>[3.6.0,)</version>
                        </requireMavenVersion>
                     </rules>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
               <autoPublish>true</autoPublish>
               <deploymentName>ProtoStream ${project.version}</deploymentName>
               <publishingServerId>central</publishingServerId>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>extras</id>
         <activation>
            <activeByDefault>true</activeByDefault>
         </activation>
         <build>
            <plugins>
               <!-- Make sure we generate src jars too -->
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-source-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>attach-sources</id>
                        <goals>
                           <goal>jar</goal>
                           <goal>test-jar</goal>
                        </goals>
                     </execution>
                  </executions>
                  <inherited>true</inherited>
               </plugin>
            </plugins>
         </build>
      </profile>
      <profile>
         <id>community-release</id>
         <activation>
            <activeByDefault>false</activeByDefault>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>
</project>
