Skip to content

Commit

Permalink
Merge pull request #374 from hazendaz/master
Browse files Browse the repository at this point in the history
Migrate project from 'javax' namespace to 'jakartaee' namespace
  • Loading branch information
hazendaz authored Apr 2, 2023
2 parents d76df7e + 22f0648 commit 6a6653e
Show file tree
Hide file tree
Showing 32 changed files with 210 additions and 317 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
os: [ubuntu-latest, macOS-latest, windows-latest]
java: [11, 17, 20, 21-ea]
distribution: ['zulu']
profile: [cdi-1.1, cdi-1.2, cdi-2.0]
fail-fast: false
max-parallel: 4
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
Expand All @@ -23,4 +22,4 @@ jobs:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
- name: Test with Maven
run: ./mvnw test -B -D"license.skip=true" -P"${{ matrix.profile }}"
run: ./mvnw test -B -D"license.skip=true"
157 changes: 51 additions & 106 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</parent>

<artifactId>mybatis-cdi</artifactId>
<version>1.1.5-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>

<name>mybatis-cdi</name>
<url>https://www.mybatis.org/cdi</url>
Expand Down Expand Up @@ -58,7 +58,9 @@
</distributionManagement>

<properties>
<clirr.comparisonVersion>1.0.3</clirr.comparisonVersion>
<java.version>11</java.version>
<java.release.version>11</java.release.version>
<clirr.comparisonVersion>1.1.4</clirr.comparisonVersion>
<findbugs.onlyAnalyze>org.mybatis.cdi.*</findbugs.onlyAnalyze>
<module.name>org.mybatis.cdi</module.name>
<osgi.import>org.mybatis.*;resolution:=optional,*</osgi.import>
Expand All @@ -69,37 +71,78 @@
</properties>

<dependencies>
<!-- MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.13</version>
<scope>provided</scope>
</dependency>

<!-- EE Apis -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>1.3.3</version>
<version>2.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>

<!-- Weld -->
<dependency>
<groupId>org.jboss.classfilewriter</groupId>
<artifactId>jboss-classfilewriter</artifactId>
<version>1.3.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>5.1.0.Final</version>
<scope>test</scope>
</dependency>

<!-- Test dependencies -->
<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-junit5</artifactId>
<version>4.0.0.Final</version>
<scope>test</scope>
</dependency>

<!-- Database -->
<dependency>
<groupId>org.jboss.narayana.jta</groupId>
<artifactId>narayana-jta</artifactId>
<artifactId>narayana-jta-jakarta</artifactId>
<version>5.13.1.Final</version>
<scope>test</scope>
</dependency>
Expand All @@ -121,26 +164,8 @@
<version>10.15.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.2.0</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>2.0.2.Final</version>
<scope>test</scope>
</dependency>
-->

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand All @@ -153,13 +178,6 @@
<version>2.0.7</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.classfilewriter</groupId>
<artifactId>jboss-classfilewriter</artifactId>
<version>1.2.5.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -209,57 +227,6 @@
</build>

<profiles>
<profile>
<id>cdi-2.0</id>
<dependencies>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>2.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>3.1.9.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>cdi-1.2</id>
<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>
<profile>
<id>jdk17on</id>
<activation>
Expand All @@ -269,28 +236,6 @@
<argLine>-Djdk.attach.allowAttachSelf --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
</properties>
</profile>
<profile>
<id>eclipse</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>2.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>3.1.9.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
18 changes: 9 additions & 9 deletions src/main/java/org/mybatis/cdi/CDIUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2023 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.
Expand All @@ -15,18 +15,18 @@
*/
package org.mybatis.cdi;

import jakarta.enterprise.context.spi.CreationalContext;
import jakarta.enterprise.inject.Any;
import jakarta.enterprise.inject.Default;
import jakarta.enterprise.inject.spi.Bean;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.enterprise.inject.spi.CDI;
import jakarta.enterprise.util.AnnotationLiteral;

import java.lang.annotation.Annotation;
import java.util.Iterator;
import java.util.Set;

import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Any;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.CDI;
import javax.enterprise.util.AnnotationLiteral;

import org.apache.ibatis.session.SqlSessionFactory;

/**
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/mybatis/cdi/JtaTransactionInterceptor.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2023 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.
Expand All @@ -15,16 +15,16 @@
*/
package org.mybatis.cdi;

import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.interceptor.Interceptor;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;
import jakarta.interceptor.Interceptor;
import jakarta.transaction.HeuristicMixedException;
import jakarta.transaction.HeuristicRollbackException;
import jakarta.transaction.NotSupportedException;
import jakarta.transaction.RollbackException;
import jakarta.transaction.Status;
import jakarta.transaction.SystemException;
import jakarta.transaction.UserTransaction;

/**
* Interceptor for JTA transactions. MyBatis should be configured to use the {@code MANAGED} transaction manager.
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/mybatis/cdi/LocalTransactionInterceptor.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2023 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.
Expand All @@ -15,20 +15,20 @@
*/
package org.mybatis.cdi;

import jakarta.inject.Inject;
import jakarta.interceptor.AroundInvoke;
import jakarta.interceptor.Interceptor;
import jakarta.interceptor.InvocationContext;
import jakarta.transaction.HeuristicMixedException;
import jakarta.transaction.HeuristicRollbackException;
import jakarta.transaction.NotSupportedException;
import jakarta.transaction.RollbackException;
import jakarta.transaction.SystemException;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.UndeclaredThrowableException;

import javax.inject.Inject;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.SystemException;

import org.apache.ibatis.session.SqlSessionManager;

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/mybatis/cdi/Mapper.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2023 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.
Expand All @@ -18,12 +18,12 @@
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import jakarta.enterprise.inject.Stereotype;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.enterprise.inject.Stereotype;

/**
* Marker interface for MyBatis mappers.
*
Expand Down
Loading

0 comments on commit 6a6653e

Please sign in to comment.