Skip to content

Commit 6a6653e

Browse files
authored
Merge pull request #374 from hazendaz/master
Migrate project from 'javax' namespace to 'jakartaee' namespace
2 parents d76df7e + 22f0648 commit 6a6653e

32 files changed

+210
-317
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
os: [ubuntu-latest, macOS-latest, windows-latest]
1111
java: [11, 17, 20, 21-ea]
1212
distribution: ['zulu']
13-
profile: [cdi-1.1, cdi-1.2, cdi-2.0]
1413
fail-fast: false
1514
max-parallel: 4
1615
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
@@ -23,4 +22,4 @@ jobs:
2322
java-version: ${{ matrix.java }}
2423
distribution: ${{ matrix.distribution }}
2524
- name: Test with Maven
26-
run: ./mvnw test -B -D"license.skip=true" -P"${{ matrix.profile }}"
25+
run: ./mvnw test -B -D"license.skip=true"

pom.xml

Lines changed: 51 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</parent>
2929

3030
<artifactId>mybatis-cdi</artifactId>
31-
<version>1.1.5-SNAPSHOT</version>
31+
<version>2.0.0-SNAPSHOT</version>
3232

3333
<name>mybatis-cdi</name>
3434
<url>https://www.mybatis.org/cdi</url>
@@ -58,7 +58,9 @@
5858
</distributionManagement>
5959

6060
<properties>
61-
<clirr.comparisonVersion>1.0.3</clirr.comparisonVersion>
61+
<java.version>11</java.version>
62+
<java.release.version>11</java.release.version>
63+
<clirr.comparisonVersion>1.1.4</clirr.comparisonVersion>
6264
<findbugs.onlyAnalyze>org.mybatis.cdi.*</findbugs.onlyAnalyze>
6365
<module.name>org.mybatis.cdi</module.name>
6466
<osgi.import>org.mybatis.*;resolution:=optional,*</osgi.import>
@@ -69,37 +71,78 @@
6971
</properties>
7072

7173
<dependencies>
74+
<!-- MyBatis -->
7275
<dependency>
7376
<groupId>org.mybatis</groupId>
7477
<artifactId>mybatis</artifactId>
7578
<version>3.5.13</version>
7679
<scope>provided</scope>
7780
</dependency>
81+
82+
<!-- EE Apis -->
7883
<dependency>
7984
<groupId>jakarta.annotation</groupId>
8085
<artifactId>jakarta.annotation-api</artifactId>
81-
<version>1.3.5</version>
86+
<version>2.1.1</version>
8287
<scope>provided</scope>
8388
</dependency>
8489
<dependency>
8590
<groupId>jakarta.transaction</groupId>
8691
<artifactId>jakarta.transaction-api</artifactId>
87-
<version>1.3.3</version>
92+
<version>2.0.1</version>
93+
<scope>provided</scope>
94+
</dependency>
95+
<dependency>
96+
<groupId>jakarta.enterprise</groupId>
97+
<artifactId>jakarta.enterprise.cdi-api</artifactId>
98+
<version>4.0.1</version>
99+
<scope>provided</scope>
100+
</dependency>
101+
102+
<!-- Weld -->
103+
<dependency>
104+
<groupId>org.jboss.classfilewriter</groupId>
105+
<artifactId>jboss-classfilewriter</artifactId>
106+
<version>1.3.0.Final</version>
88107
<scope>provided</scope>
89108
</dependency>
109+
<dependency>
110+
<groupId>org.jboss.weld.se</groupId>
111+
<artifactId>weld-se-core</artifactId>
112+
<version>5.1.0.Final</version>
113+
<scope>test</scope>
114+
</dependency>
90115

91-
<!-- Test dependencies -->
116+
<!-- Tests -->
92117
<dependency>
93118
<groupId>org.junit.jupiter</groupId>
94119
<artifactId>junit-jupiter-engine</artifactId>
95120
<version>5.9.2</version>
96121
<scope>test</scope>
97122
</dependency>
123+
<dependency>
124+
<groupId>org.mockito</groupId>
125+
<artifactId>mockito-core</artifactId>
126+
<version>5.2.0</version>
127+
<scope>test</scope>
128+
</dependency>
129+
<dependency>
130+
<groupId>org.mockito</groupId>
131+
<artifactId>mockito-junit-jupiter</artifactId>
132+
<version>5.2.0</version>
133+
<scope>test</scope>
134+
</dependency>
135+
<dependency>
136+
<groupId>org.jboss.weld</groupId>
137+
<artifactId>weld-junit5</artifactId>
138+
<version>4.0.0.Final</version>
139+
<scope>test</scope>
140+
</dependency>
98141

99142
<!-- Database -->
100143
<dependency>
101144
<groupId>org.jboss.narayana.jta</groupId>
102-
<artifactId>narayana-jta</artifactId>
145+
<artifactId>narayana-jta-jakarta</artifactId>
103146
<version>5.13.1.Final</version>
104147
<scope>test</scope>
105148
</dependency>
@@ -121,26 +164,8 @@
121164
<version>10.15.2.0</version>
122165
<scope>test</scope>
123166
</dependency>
124-
<dependency>
125-
<groupId>org.mockito</groupId>
126-
<artifactId>mockito-core</artifactId>
127-
<version>5.2.0</version>
128-
<scope>test</scope>
129-
</dependency>
130-
<dependency>
131-
<groupId>org.mockito</groupId>
132-
<artifactId>mockito-junit-jupiter</artifactId>
133-
<version>5.2.0</version>
134-
<scope>test</scope>
135-
</dependency>
136-
<!-- TODO: Switch to weld-junit5 once we drop cdi 1.1 support
137-
<dependency>
138-
<groupId>org.jboss.weld</groupId>
139-
<artifactId>weld-junit5</artifactId>
140-
<version>2.0.2.Final</version>
141-
<scope>test</scope>
142-
</dependency>
143-
-->
167+
168+
<!-- Logging -->
144169
<dependency>
145170
<groupId>org.slf4j</groupId>
146171
<artifactId>slf4j-api</artifactId>
@@ -153,13 +178,6 @@
153178
<version>2.0.7</version>
154179
<scope>test</scope>
155180
</dependency>
156-
157-
<dependency>
158-
<groupId>org.jboss.classfilewriter</groupId>
159-
<artifactId>jboss-classfilewriter</artifactId>
160-
<version>1.2.5.Final</version>
161-
<scope>provided</scope>
162-
</dependency>
163181
</dependencies>
164182

165183
<build>
@@ -209,57 +227,6 @@
209227
</build>
210228

211229
<profiles>
212-
<profile>
213-
<id>cdi-2.0</id>
214-
<dependencies>
215-
<dependency>
216-
<groupId>jakarta.enterprise</groupId>
217-
<artifactId>jakarta.enterprise.cdi-api</artifactId>
218-
<version>2.0.2</version>
219-
<scope>provided</scope>
220-
</dependency>
221-
<dependency>
222-
<groupId>org.jboss.weld.se</groupId>
223-
<artifactId>weld-se-core</artifactId>
224-
<version>3.1.9.Final</version>
225-
<scope>test</scope>
226-
</dependency>
227-
</dependencies>
228-
</profile>
229-
<profile>
230-
<id>cdi-1.2</id>
231-
<dependencies>
232-
<dependency>
233-
<groupId>javax.enterprise</groupId>
234-
<artifactId>cdi-api</artifactId>
235-
<version>1.2</version>
236-
<scope>provided</scope>
237-
</dependency>
238-
<dependency>
239-
<groupId>org.jboss.weld.se</groupId>
240-
<artifactId>weld-se</artifactId>
241-
<version>2.4.8.Final</version>
242-
<scope>test</scope>
243-
</dependency>
244-
</dependencies>
245-
</profile>
246-
<profile>
247-
<id>cdi-1.1</id>
248-
<dependencies>
249-
<dependency>
250-
<groupId>javax.enterprise</groupId>
251-
<artifactId>cdi-api</artifactId>
252-
<version>1.1</version>
253-
<scope>provided</scope>
254-
</dependency>
255-
<dependency>
256-
<groupId>org.jboss.weld.se</groupId>
257-
<artifactId>weld-se</artifactId>
258-
<version>2.1.2.Final</version>
259-
<scope>test</scope>
260-
</dependency>
261-
</dependencies>
262-
</profile>
263230
<profile>
264231
<id>jdk17on</id>
265232
<activation>
@@ -269,28 +236,6 @@
269236
<argLine>-Djdk.attach.allowAttachSelf --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
270237
</properties>
271238
</profile>
272-
<profile>
273-
<id>eclipse</id>
274-
<activation>
275-
<property>
276-
<name>m2e.version</name>
277-
</property>
278-
</activation>
279-
<dependencies>
280-
<dependency>
281-
<groupId>jakarta.enterprise</groupId>
282-
<artifactId>jakarta.enterprise.cdi-api</artifactId>
283-
<version>2.0.2</version>
284-
<scope>provided</scope>
285-
</dependency>
286-
<dependency>
287-
<groupId>org.jboss.weld.se</groupId>
288-
<artifactId>weld-se-core</artifactId>
289-
<version>3.1.9.Final</version>
290-
<scope>test</scope>
291-
</dependency>
292-
</dependencies>
293-
</profile>
294239
</profiles>
295240

296241
</project>

src/main/java/org/mybatis/cdi/CDIUtils.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2022 the original author or authors.
2+
* Copyright 2013-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,18 +15,18 @@
1515
*/
1616
package org.mybatis.cdi;
1717

18+
import jakarta.enterprise.context.spi.CreationalContext;
19+
import jakarta.enterprise.inject.Any;
20+
import jakarta.enterprise.inject.Default;
21+
import jakarta.enterprise.inject.spi.Bean;
22+
import jakarta.enterprise.inject.spi.BeanManager;
23+
import jakarta.enterprise.inject.spi.CDI;
24+
import jakarta.enterprise.util.AnnotationLiteral;
25+
1826
import java.lang.annotation.Annotation;
1927
import java.util.Iterator;
2028
import java.util.Set;
2129

22-
import javax.enterprise.context.spi.CreationalContext;
23-
import javax.enterprise.inject.Any;
24-
import javax.enterprise.inject.Default;
25-
import javax.enterprise.inject.spi.Bean;
26-
import javax.enterprise.inject.spi.BeanManager;
27-
import javax.enterprise.inject.spi.CDI;
28-
import javax.enterprise.util.AnnotationLiteral;
29-
3030
import org.apache.ibatis.session.SqlSessionFactory;
3131

3232
/**

src/main/java/org/mybatis/cdi/JtaTransactionInterceptor.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2022 the original author or authors.
2+
* Copyright 2013-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,16 +15,16 @@
1515
*/
1616
package org.mybatis.cdi;
1717

18-
import javax.enterprise.inject.Instance;
19-
import javax.inject.Inject;
20-
import javax.interceptor.Interceptor;
21-
import javax.transaction.HeuristicMixedException;
22-
import javax.transaction.HeuristicRollbackException;
23-
import javax.transaction.NotSupportedException;
24-
import javax.transaction.RollbackException;
25-
import javax.transaction.Status;
26-
import javax.transaction.SystemException;
27-
import javax.transaction.UserTransaction;
18+
import jakarta.enterprise.inject.Instance;
19+
import jakarta.inject.Inject;
20+
import jakarta.interceptor.Interceptor;
21+
import jakarta.transaction.HeuristicMixedException;
22+
import jakarta.transaction.HeuristicRollbackException;
23+
import jakarta.transaction.NotSupportedException;
24+
import jakarta.transaction.RollbackException;
25+
import jakarta.transaction.Status;
26+
import jakarta.transaction.SystemException;
27+
import jakarta.transaction.UserTransaction;
2828

2929
/**
3030
* Interceptor for JTA transactions. MyBatis should be configured to use the {@code MANAGED} transaction manager.

src/main/java/org/mybatis/cdi/LocalTransactionInterceptor.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2022 the original author or authors.
2+
* Copyright 2013-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,20 +15,20 @@
1515
*/
1616
package org.mybatis.cdi;
1717

18+
import jakarta.inject.Inject;
19+
import jakarta.interceptor.AroundInvoke;
20+
import jakarta.interceptor.Interceptor;
21+
import jakarta.interceptor.InvocationContext;
22+
import jakarta.transaction.HeuristicMixedException;
23+
import jakarta.transaction.HeuristicRollbackException;
24+
import jakarta.transaction.NotSupportedException;
25+
import jakarta.transaction.RollbackException;
26+
import jakarta.transaction.SystemException;
27+
1828
import java.io.Serializable;
1929
import java.lang.reflect.InvocationTargetException;
2030
import java.lang.reflect.UndeclaredThrowableException;
2131

22-
import javax.inject.Inject;
23-
import javax.interceptor.AroundInvoke;
24-
import javax.interceptor.Interceptor;
25-
import javax.interceptor.InvocationContext;
26-
import javax.transaction.HeuristicMixedException;
27-
import javax.transaction.HeuristicRollbackException;
28-
import javax.transaction.NotSupportedException;
29-
import javax.transaction.RollbackException;
30-
import javax.transaction.SystemException;
31-
3232
import org.apache.ibatis.session.SqlSessionManager;
3333

3434
/**

src/main/java/org/mybatis/cdi/Mapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2022 the original author or authors.
2+
* Copyright 2013-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,12 +18,12 @@
1818
import static java.lang.annotation.ElementType.TYPE;
1919
import static java.lang.annotation.RetentionPolicy.RUNTIME;
2020

21+
import jakarta.enterprise.inject.Stereotype;
22+
2123
import java.lang.annotation.Inherited;
2224
import java.lang.annotation.Retention;
2325
import java.lang.annotation.Target;
2426

25-
import javax.enterprise.inject.Stereotype;
26-
2727
/**
2828
* Marker interface for MyBatis mappers.
2929
*

0 commit comments

Comments
 (0)