<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>net.lecousin.reactive-data-relational</groupId>
  <artifactId>parent</artifactId>
  <version>0.4.2</version>
  <packaging>pom</packaging>
  
  <name>net.lecousin.reactive-data-relational aka lc-spring-data-r2dbc</name>
  <description>Provide basic ORM features not covered by Spring Data R2DBC, such as joins, lazy loading, cascade</description>
  <url>https://github.com/lecousin/lc-spring-data-r2dbc</url>

  <licenses>
    <license>
      <name>Apache 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
    
  <developers>
    <developer>
      <id>lecousin</id>
      <name>Guillaume Le Cousin</name>
    </developer>
  </developers>
  
  <scm>
    <connection>scm:git:https://github.com/lecousin/lc-spring-data-r2dbc.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:lecousin/lc-spring-data-r2dbc.git</developerConnection>
    <url>https://github.com/lecousin/lc-spring-data-r2dbc</url>
    <tag>HEAD</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  
  
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  
    <spring-boot.version>2.5.6</spring-boot.version>
    <junit-jupiter.version>5.8.1</junit-jupiter.version>
    <javassist.version>3.28.0-GA</javassist.version>
    <commons-lang3.version>3.12.0</commons-lang3.version>
    
    <r2dbc-h2.version>0.8.4.RELEASE</r2dbc-h2.version>
    <r2dbc-postgres.version>0.8.10.RELEASE</r2dbc-postgres.version>
    <r2dbc-mysql.version>0.8.2.RELEASE</r2dbc-mysql.version>

    <!-- Versions to force for dependencies -->    
    <reactor.version>3.4.11</reactor.version>
    
    <maven-compiler.version>3.8.0</maven-compiler.version>
    <maven-source.version>3.2.0</maven-source.version>
    <maven-javadoc.version>3.2.0</maven-javadoc.version>
    <maven-jar.version>3.2.0</maven-jar.version>
    <maven-surefire.version>3.0.0-M5</maven-surefire.version>
    <maven-jacoco.version>0.8.4</maven-jacoco.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    
    <sonar.projectName>lc-spring-data-r2dbc</sonar.projectName>
    <sonar.java.source>11</sonar.java.source>
    <sonar.test.exclusions>**/src/test/**/*</sonar.test.exclusions>
    <sonar.exclusions>test-spring-boot/**/*,test-junit-5/**/*</sonar.exclusions>
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <version>${spring-boot.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.junit.vintage</groupId>
          <artifactId>junit-vintage-engine</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-core</artifactId>
        <version>${reactor.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>${javassist.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
      </dependency>
      
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler.version}</version>
          <configuration>
            <release>11</release>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar.version}</version>
        </plugin>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source.version}</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>${maven-javadoc.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <additionalOptions>-Xdoclint:none</additionalOptions>
              </configuration>
            </execution>
          </executions>
        </plugin>
        
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven-surefire.version}</version>
        </plugin>
        
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${maven-jacoco.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>readme-md</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.basedir}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/src</directory>
                  <includes>
                    <include>README.md</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>
              <encoding>UTF-8</encoding>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ossrh</id>
      <activation>
        <property>
          <name>ossrh</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  
  <modules>
    <module>core</module>
    <module>h2</module>
    <module>mysql</module>
    <module>postgres</module>
    <module>test-junit-5</module>
    <module>test-spring-boot</module>
    <module>jacoco-report-aggregate</module>
  </modules>
</project>