<?xml version="1.0" encoding="UTF-8"?>
<!--

       Copyright 2013-2024 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>

  <parent>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis-parent</artifactId>
    <version>45</version>
    <relativePath />
  </parent>

  <groupId>org.mybatis</groupId>
  <artifactId>mybatis-cdi</artifactId>
  <version>2.1.0</version>

  <name>mybatis-cdi</name>
  <url>https://www.mybatis.org/cdi/</url>

  <inceptionYear>2013</inceptionYear>

  <scm>
    <connection>scm:git:ssh://git@github.com/mybatis/cdi.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/mybatis/cdi.git</developerConnection>
    <tag>mybatis-cdi-2.1.0</tag>
    <url>https://github.com/mybatis/cdi/</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/mybatis/cdi/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Github</system>
    <url>https://github.com/mybatis/cdi/actions</url>
  </ciManagement>
  <distributionManagement>
    <site>
      <id>gh-pages-scm</id>
      <name>Mybatis GitHub Pages</name>
      <url>scm:git:ssh://git@github.com/mybatis/cdi.git</url>
    </site>
  </distributionManagement>

  <properties>
    <!-- Java Usage -->
    <java.version>17</java.version>
    <java.release.version>17</java.release.version>

    <!-- Versions -->
    <byte-buddy.version>1.15.1</byte-buddy.version>
    <derby.version>10.17.1.0</derby.version>
    <mockito.version>5.13.0</mockito.version>
    <slf4j.version>2.0.16</slf4j.version>

    <!-- Analysis -->
    <clirr.comparisonVersion>1.1.4</clirr.comparisonVersion>
    <findbugs.onlyAnalyze>org.mybatis.cdi.*</findbugs.onlyAnalyze>

    <!-- Automatic Module Name -->
    <module.name>org.mybatis.cdi</module.name>

    <!-- OSGI Headers -->
    <osgi.dynamicImport>*</osgi.dynamicImport>

    <!-- Reproducible Builds -->
    <project.build.outputTimestamp>1726438225</project.build.outputTimestamp>

    <!-- Surefire Setup -->
    <argLine>-javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar</argLine>
  </properties>

  <dependencies>
    <!-- MyBatis -->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.5.16</version>
      <scope>provided</scope>
    </dependency>

    <!-- EE Apis -->
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>3.0.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.transaction</groupId>
      <artifactId>jakarta.transaction-api</artifactId>
      <version>2.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.enterprise</groupId>
      <artifactId>jakarta.enterprise.cdi-api</artifactId>
      <version>4.1.0</version>
      <scope>provided</scope>
    </dependency>

    <!-- Weld -->
    <dependency>
      <groupId>org.jboss.classfilewriter</groupId>
      <artifactId>jboss-classfilewriter</artifactId>
      <version>1.3.1.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld.se</groupId>
      <artifactId>weld-se-core</artifactId>
      <version>6.0.0.Beta4</version>
      <scope>test</scope>
    </dependency>

    <!-- Tests -->
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy</artifactId>
      <version>${byte-buddy.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy-agent</artifactId>
      <version>${byte-buddy.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.11.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-junit5</artifactId>
      <version>5.0.0.Beta1</version>
      <scope>test</scope>
    </dependency>

    <!-- Database -->
    <dependency>
      <groupId>org.jboss.narayana.jta</groupId>
      <artifactId>narayana-jta</artifactId>
      <version>7.0.2.Final</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>${derby.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derbyshared</artifactId>
      <version>${derby.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derbyoptionaltools</artifactId>
      <version>${derby.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <annotationProcessorPaths>
            <path>
              <groupId>net.bytebuddy</groupId>
              <artifactId>byte-buddy-agent</artifactId>
              <version>${byte-buddy.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <property>
              <name>derby.stream.error.file</name>
              <value>${project.build.directory}/derby.log</value>
            </property>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <id>default-test</id>
            <configuration>
              <excludes>
                <exclude>**/FooServiceJTATest.java</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>jta-test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>**/FooServiceTest.java</exclude>
                <exclude>**/MybatisExtensionTest.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <!-- Note: Maven bug resulted in default not being set correctly, assumption english on default, so 'en' was switched to 'default' to get original behaviour. -->
          <locales>default,zh_CN</locales>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <!-- NOTE: Do not add back 'cdi-2.0', clirr needs it defined to look back to old poms.  That is javax namespace.  It is not intended to be present now. -->
  <profiles>
    <profile>
      <id>17</id>
      <activation>
        <jdk>[17,)</jdk>
      </activation>
      <properties>
        <derby.version>10.16.1.1</derby.version>
      </properties>
    </profile>
    <profile>
      <id>19</id>
      <activation>
        <jdk>[19,)</jdk>
      </activation>
      <properties>
        <derby.version>10.17.1.0</derby.version>
      </properties>
    </profile>
  </profiles>

</project>
