<?xml version="1.0" encoding="UTF-8"?>
<!--

       Copyright 2013-2019 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

          http://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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis-parent</artifactId>
    <version>31</version>
    <relativePath />
  </parent>

  <artifactId>mybatis-cdi</artifactId>
  <version>1.1.1</version>
  <packaging>jar</packaging>

  <name>mybatis-cdi</name>
  <url>http://mybatis.org</url>

  <inceptionYear>2013</inceptionYear>

  <scm>
    <url>http://github.com/mybatis/cdi</url>
    <connection>scm:git:ssh://github.com/mybatis/cdi.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/mybatis/cdi.git</developerConnection>
    <tag>mybatis-cdi-1.1.1</tag>
  </scm>
  <issueManagement>
    <system>GitHub Issue Management</system>
    <url>https://github.com/mybatis/cdi/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/mybatis/cdi</url>
  </ciManagement>
  <distributionManagement>
    <site>
      <id>gh-pages</id>
      <name>Mybatis GitHub Pages</name>
      <url>git:ssh://git@github.com/mybatis/cdi.git?gh-pages#</url>
    </site>
  </distributionManagement>

  <properties>
    <clirr.comparisonVersion>1.0.3</clirr.comparisonVersion>
    <findbugs.onlyAnalyze>org.mybatis.cdi.*</findbugs.onlyAnalyze>
    <module.name>org.mybatis.cdi</module.name>
    <osgi.import>org.mybatis.*;resolution:=optional,*</osgi.import>
    <osgi.dynamicImport>*</osgi.dynamicImport>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.5.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>1.3.5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.transaction</groupId>
      <artifactId>jakarta.transaction-api</artifactId>
      <version>1.3.3</version>
      <scope>provided</scope>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.5.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.atomikos</groupId>
      <artifactId>transactions-jdbc</artifactId>
      <version>5.0.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>10.14.2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.2.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>3.2.4</version>
      <scope>test</scope>
    </dependency>
    <!-- TODO: Switch to weld-junit5 once we drop cdi 1.1 support
    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-junit5</artifactId>
      <version>1.3.1.Final</version>
      <scope>test</scope>
    </dependency>
    -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.30</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.30</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemProperties>
            <property>
              <name>derby.stream.error.file</name>
              <value>${project.build.directory}/derby.log</value>
            </property>
            <property>
              <name>com.atomikos.icatch.log_base_dir</name>
              <value>${project.build.directory}</value>
            </property>
          </systemProperties>
        </configuration>
        <executions>
            <execution>
              <id>default-test</id>
              <configuration>
                <excludes>
                  <exclude>**/FooServiceJTATest.java</exclude>
                </excludes>
              </configuration>
            </execution>
            <execution>
              <id>jta-test</id>
              <configuration>
                <excludes>
                  <exclude>**/FooServiceTest.java</exclude>
                  <exclude>**/MybatisExtensionTest.java</exclude>
                </excludes>
              </configuration>
              <goals>
                <goal>test</goal>
              </goals>
            </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <locales>en</locales>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>cdi-2.0</id>
      <dependencies>
        <dependency>
          <groupId>javax.enterprise</groupId>
          <artifactId>cdi-api</artifactId>
          <version>2.0</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.weld.se</groupId>
          <artifactId>weld-se-core</artifactId>
          <version>3.1.3.Final</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>cdi-1.2</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>javax.enterprise</groupId>
          <artifactId>cdi-api</artifactId>
          <version>1.2</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.weld.se</groupId>
          <artifactId>weld-se</artifactId>
          <version>2.4.8.Final</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>cdi-1.1</id>
      <dependencies>
        <dependency>
          <groupId>javax.enterprise</groupId>
          <artifactId>cdi-api</artifactId>
          <version>1.1</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.weld.se</groupId>
          <artifactId>weld-se</artifactId>
          <version>2.1.2.Final</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

</project>
