<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
  ~ Copyright 2022 the original author or authors.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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.ttddyy.observation</groupId>
    <artifactId>datasource-micrometer-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0.0</version>
    <name>datasource-micrometer-parent</name>
    <description>Micrometer observation for JDBC</description>
    <url>https://github.com/jdbc-observations/datasource-micrometer</url>

    <properties>
        <java.version>17</java.version>
        <micrometer-bom.version>1.10.2</micrometer-bom.version>
        <micrometer-tracing-bom.version>1.0.0</micrometer-tracing-bom.version>
        <spring-javaformat.version>0.0.34</spring-javaformat.version>

        <!-- Tests  -->
        <junit.version>5.8.2</junit.version>
        <mockito.version>4.6.1</mockito.version>
        <assertj.version>3.23.1</assertj.version>

        <!-- datasource-micrometer module -->
        <datasource-proxy.version>1.8.1</datasource-proxy.version>

        <!-- datasource-micrometer-spring-boot module -->
        <spring-boot.version>3.0.0</spring-boot.version>

        <!-- Docs -->
        <micrometer-docs-generator.version>1.0.0</micrometer-docs-generator.version>
        <asciidoctor.maven.plugin.version>2.2.2</asciidoctor.maven.plugin.version>
        <maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
        <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
        <asciidoctorj.version>2.5.1</asciidoctorj.version>
        <jruby-complete.version>9.2.19.0</jruby-complete.version>
        <ant-contrib.version>1.0b3</ant-contrib.version>
        <antelopetasks.version>3.2.10</antelopetasks.version>
        <ant-nodeps.version>1.8.1</ant-nodeps.version>
        <script-commons-logging.version>1.2</script-commons-logging.version>
        <script-spring-core.version>5.3.22</script-spring-core.version>
        <script-jackson-databind.version>2.13.3</script-jackson-databind.version>
        <git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>

        <maven-deploy-plugin.version>3.0.0</maven-deploy-plugin.version>
    </properties>

    <modules>
        <module>datasource-micrometer</module>
        <module>datasource-micrometer-spring-boot</module>
        <module>docs</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>io.spring.javaformat</groupId>
                <artifactId>spring-javaformat-maven-plugin</artifactId>
                <version>${spring-javaformat.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.1</version>
                <configuration>
                    <skippedModules>datasource-micrometer-docs</skippedModules>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>${git-commit-id-plugin.version}</version>
                    <configuration>
                        <verbose>true</verbose>
                        <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
                        <generateGitPropertiesFile>true</generateGitPropertiesFile>
                        <generateGitPropertiesFilename>
                            ${project.build.outputDirectory}/git.properties
                        </generateGitPropertiesFilename>
                        <skipPoms>false</skipPoms>
                        <useNativeGit>true</useNativeGit>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>${asciidoctor.maven.plugin.version}</version>
                    <configuration>
                        <attributes>
                            <docinfo>shared</docinfo>
                            <allow-uri-read>true</allow-uri-read>
                            <nofooter/>
                            <toc>left</toc>
                            <toc-levels>4</toc-levels>
                            <sectlinks>true</sectlinks>
                            <sources-root>${project.basedir}/src@</sources-root>
                            <asciidoc-sources-root>${project.basedir}/src/main/asciidoc@</asciidoc-sources-root>
                            <generated-resources-root>${project.basedir}/target/generated-resources@
                            </generated-resources-root>
                            <!-- Use this attribute the reference code from another module -->
                            <!-- Note the @ at the end, lowering the precedence of the attribute -->
                            <project-root>${maven.multiModuleProjectDirectory}@</project-root>
                            <!-- It's mandatory for you to pass the docs.main property -->
                            <github-repo>datasource-micrometer</github-repo>
                            <github-project>https://github.com/jdbc-observations/datasource-micrometer@</github-project>
                            <github-raw>
                                https://raw.githubusercontent.com/jdbc-observations/datasource-micrometer/${git.branch}@
                            </github-raw>
                            <github-code>https://github.com/jdbc-observations/datasource-micrometer/tree/${git.branch}@
                            </github-code>
                            <github-issues>https://github.com/jdbc-observations/datasource-micrometer/issues/@</github-issues>
                            <github-pulls>https://github.com/jdbc-observations/datasource-micrometer/pulls/@</github-pulls>
                            <github-wiki>https://github.com/jdbc-observations/datasource-micrometer/wiki@</github-wiki>
                            <github-master-code>https://github.com/jdbc-observations/datasource-micrometer/tree/main@
                            </github-master-code>

                            <project-version>${project.version}@</project-version>
                            <github-tag>${git.branch}@</github-tag>
                            <raw-docs-url>${github-raw}@</raw-docs-url>
                        </attributes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

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

    <scm>
        <connection>scm:git:git@github.com:jdbc-observations/datasource-micrometer.git
        </connection>
        <developerConnection>
            scm:git:git@github.com:jdbc-observations/datasource-micrometer.git
        </developerConnection>
        <url>git@github.com:jdbc-observations/datasource-micrometer.git</url>
    </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>

    <developers>
        <developer>
            <id>tadaya</id>
            <name>Tadaya Tsuyukubo</name>
            <email>tadaya@ttddyy.net</email>
            <url>http://www.ttddyy.net</url>
        </developer>
    </developers>

    <dependencies>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-bom</artifactId>
                <version>${micrometer-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-tracing-bom</artifactId>
                <version>${micrometer-tracing-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-bom</artifactId>
                <version>${mockito.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

    <profiles>
        <!-- This profile is activated by "publish-ossrh.yml" github action -->
        <profile>
            <id>github-ossrh</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent gpg from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <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</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
