<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>com.google.cloudspannerecosystem</groupId>
  <artifactId>spanner-change-watcher</artifactId>
  <version>1.2.1</version>
  <name>Google Cloud Spanner Change Watcher Parent</name>
  <description>Google Cloud Spanner Change Watcher and Publisher is a framework that emits events when a row has been changed in a Cloud Spanner database. These row change events can be captured and processed in-process as part of a user application, or they can be published to Google Cloud Pubsub for consumption by any other application.</description>
  <url>https://github.com/cloudspannerecosystem/spanner-change-watcher</url>
  <packaging>pom</packaging>
  <organization>
    <name>Google LLC</name>
  </organization>
 <developers>
    <developer>
      <name>Knut Olav Løite</name>
      <email>koloite@gmail.com</email>
      <organizationUrl>https://github.com/olavloite</organizationUrl>
    </developer>
    <developer>
      <name>Leonhard Gruenschloss</name>
      <organization>Google</organization>
    </developer>
  </developers>
  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
  <scm>
    <connection>scm:git:git@github.com:cloudspannerecosystem/spanner-change-watcher.git</connection>
    <developerConnection>scm:git:git@github.com:cloudspannerecosystem/spanner-change-watcher.git</developerConnection>
    <url>https://github.com/cloudspannerecosystem/spanner-change-watcher</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <url>https://github.com/cloudspannerecosystem/spanner-change-watcher/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  
  <properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <skipITs>true</skipITs>
    
    <avro.version>1.11.0</avro.version>
    
    <gax.version>1.67.0</gax.version>
    <junit.version>4.13.1</junit.version>
    <truth.version>1.1.3</truth.version>
    <mockito.version>3.3.3</mockito.version>
  </properties>
  
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloudspannerecosystem</groupId>
        <artifactId>google-cloud-spanner-change-watcher</artifactId>
        <version>1.2.1</version>
        <exclusions>
          <exclusion>
            <groupId>org.conscrypt</groupId>
            <artifactId>conscrypt-openjdk-uber</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.google.cloudspannerecosystem</groupId>
        <artifactId>google-cloud-spanner-change-publisher</artifactId>
        <version>1.2.1</version>
      </dependency>
      <dependency>
        <groupId>com.google.cloudspannerecosystem</groupId>
        <artifactId>google-cloud-spanner-change-archiver</artifactId>
        <version>1.2.1</version>
      </dependency>
      
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-spanner-bom</artifactId>
        <type>pom</type>
        <scope>import</scope>
        <version>6.17.3</version>
      </dependency>
       
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>libraries-bom</artifactId>
        <version>24.1.1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      
      <dependency>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro</artifactId>
        <version>${avro.version}</version>
      </dependency>
      
      <!-- Test dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.google.truth</groupId>
        <artifactId>truth</artifactId>
        <version>${truth.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  
  <modules>
    <module>google-cloud-spanner-change-watcher</module>
    <module>google-cloud-spanner-change-publisher</module>
    <module>google-cloud-spanner-change-archiver</module>
    <module>samples/spanner-change-watcher-samples</module>
    <module>samples/spanner-change-publisher-samples</module>
  </modules>
  
  <build>
    <pluginManagement>
      <plugins>
        <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>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.1.0</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>8.29</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>3.0.0-M4</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.5</version>
            <configuration>
              <source>${java.version}</source>
              <target>${java.version}</target>
            </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M3</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <headerLocation>java.header</headerLocation>
              <configLocation>license-checks.xml</configLocation>
              <consoleOutput>true</consoleOutput>
              <failOnViolation>true</failOnViolation>
              <violationSeverity>error</violationSeverity>
              <failsOnError>true</failsOnError>
              <includeTestSourceDirectory>true</includeTestSourceDirectory>
              <!-- Explicitly set the source directory to avoid running checkstyle on generated sources. -->
              <sourceDirectories>
                <sourceDirectory>src/main</sourceDirectory>
              </sourceDirectories>
              <testSourceDirectories>
                <testSourceDirectory>src/test</testSourceDirectory>
              </testSourceDirectories>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>IT*</excludes>
           <systemProperties>
             <property> 
               <name>java.util.logging.config.file</name>
               <value>src/test/resources/logging.properties</value>
             </property>
           </systemProperties>
         </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <forkedProcessTimeoutInSeconds>3000</forkedProcessTimeoutInSeconds>
          <forkCount>8</forkCount>
          <argLine>-Xmx1024m</argLine>
        </configuration>
        <executions>
          <execution>
            <id>default</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
            <configuration>
              <excludedGroups>com.google.cloud.spanner.watcher.it.StressIntegrationTest</excludedGroups>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>enable-integration-tests</id>
      <properties>
        <skipITs>false</skipITs>
      </properties>
    </profile>
    <profile>
      <id>no-stress-integration-tests</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <skipStressTests>true</skipStressTests>
      </properties>
    </profile>
    <profile>
      <id>stress-integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <forkedProcessTimeoutInSeconds>3000</forkedProcessTimeoutInSeconds>
              <forkCount>8</forkCount>
              <argLine>-Xmx1024m</argLine>
            </configuration>
            <executions>
              <execution>
                <id>stress-integration-test</id>
                <goals>
                  <goal>integration-test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>performRelease</name>
        </property>
      </activation>
      <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>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <doclint>none</doclint>
                  <source>8</source>
                </configuration>
              </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>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>allow-snapshots</id>
      <repositories>
        <repository>
          <id>sonatype-snapshots</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>
  
</project>
