Skip to content

Commit c0d7cc1

Browse files
authored
Merge pull request #980 from hazendaz/master
Build updates - use standard directory layout
2 parents 88b887a + 3f0679a commit c0d7cc1

File tree

69 files changed

+77
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+77
-95
lines changed

pom.xml

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
<!-- Maven compiler options -->
110110
<java.version>17</java.version>
111111
<java.release.version>17</java.release.version>
112+
<java.test.version>17</java.test.version>
113+
<java.test.release.version>17</java.test.release.version>
112114

113115
<derby.version>10.17.1.0</derby.version>
114116
<mybatis.version>3.5.16</mybatis.version>
@@ -155,6 +157,14 @@
155157
<scope>provided</scope>
156158
</dependency>
157159

160+
<dependency>
161+
<groupId>org.aspectj</groupId>
162+
<artifactId>aspectjweaver</artifactId>
163+
<version>1.9.22.1</version>
164+
<scope>compile</scope>
165+
<optional>true</optional>
166+
</dependency>
167+
158168
<!-- Test dependencies -->
159169

160170
<dependency>
@@ -276,10 +286,6 @@
276286
<groupId>nekohtml</groupId>
277287
<artifactId>nekohtml</artifactId>
278288
</exclusion>
279-
<exclusion>
280-
<groupId>junit</groupId>
281-
<artifactId>junit</artifactId>
282-
</exclusion>
283289
</exclusions>
284290
</dependency>
285291
<dependency>
@@ -323,12 +329,6 @@
323329
<version>6.1.0</version>
324330
<scope>test</scope>
325331
</dependency>
326-
<dependency>
327-
<groupId>org.aspectj</groupId>
328-
<artifactId>aspectjweaver</artifactId>
329-
<version>1.9.22.1</version>
330-
<optional>true</optional>
331-
</dependency>
332332

333333
<dependency>
334334
<groupId>net.bytebuddy</groupId>
@@ -402,20 +402,12 @@
402402
<directory>${project.basedir}/src/main/resources</directory>
403403
</resource>
404404
</resources>
405-
<testResources>
406-
<testResource>
407-
<directory>${project.build.testSourceDirectory}</directory>
408-
<excludes>
409-
<exclude>**/*.java</exclude>
410-
</excludes>
411-
</testResource>
412-
</testResources>
413405
<plugins>
414406
<plugin>
415407
<groupId>org.apache.maven.plugins</groupId>
416408
<artifactId>maven-surefire-plugin</artifactId>
417409
<configuration>
418-
<systemProperties>
410+
<systemPropertyVariables>
419411
<property>
420412
<name>derby.stream.error.file</name>
421413
<value>${project.build.directory}/derby.log</value>
@@ -424,7 +416,7 @@
424416
<name>com.atomikos.icatch.log_base_dir</name>
425417
<value>${project.build.directory}</value>
426418
</property>
427-
</systemProperties>
419+
</systemPropertyVariables>
428420
</configuration>
429421
</plugin>
430422
<plugin>
@@ -442,7 +434,7 @@
442434
<outputDirectory>${project.build.directory}/site-src</outputDirectory>
443435
<resources>
444436
<resource>
445-
<directory>src/site</directory>
437+
<directory>${project.basedir}/src/site</directory>
446438
<filtering>true</filtering>
447439
</resource>
448440
</resources>
@@ -474,23 +466,14 @@
474466
</plugins>
475467
</build>
476468

477-
<profiles>
478-
<profile>
479-
<id>pre16</id>
480-
<activation>
481-
<jdk>(,16)</jdk>
482-
</activation>
483-
<properties>
484-
<derby.version>10.15.2.0</derby.version>
485-
</properties>
486-
</profile>
469+
<profiles>
487470
<profile>
488471
<id>17</id>
489472
<activation>
490473
<jdk>[17,)</jdk>
491474
</activation>
492475
<properties>
493-
<derby.version>10.16.1.1</derby.version>
476+
<derby.version>10.16.1.1</derby.version>
494477
</properties>
495478
</profile>
496479
<profile>
@@ -499,7 +482,7 @@
499482
<jdk>[19,)</jdk>
500483
</activation>
501484
<properties>
502-
<derby.version>10.17.1.0</derby.version>
485+
<derby.version>10.17.1.0</derby.version>
503486
</properties>
504487
</profile>
505488
</profiles>

src/site/es/markdown/mappers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Si se indican ambas se añadirán todos los mappers que cumplan **cualquier** cr
141141

142142
Los mappers descubiertos serán nombrados usando la estratégia de nombres por defecto de Spring para los componentes autodetectados (see [the Spring reference document(Core Technologies -Naming autodetected components-](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-scanning-name-generator)).
143143
Es decir, si no se encuentra ninguna anotación, se usará el nombre no cualificado sin capitalizar del mapper. Pero si se encuentra una anotación `@Component` o JSR-330 `@Named` se obtendrá el nombre de dicha anotación.
144-
Fíjate que puedes usar como valor de la `annotation` el valor `org.springframework.stereotype.Component`, `javax.inject.Named` (if you have JSE 6) o una anotación propia (que debe ser a su vez anotada) de forma que la anotación hará las veces de localizador y de proveedor de nombre.
144+
Fíjate que puedes usar como valor de la `annotation` el valor `org.springframework.stereotype.Component`, `jakarta.inject.Named` (if you have Jakarta EE) o una anotación propia (que debe ser a su vez anotada) de forma que la anotación hará las veces de localizador y de proveedor de nombre.
145145

146146
<span class="label important">NOTE</span>
147147
`<context:component-scan/>` no puede encontrar y registrar mappers. Los mappers son interfaces y, para poderlos registrar en Spring, el scanner deben conocer cómo crear un `MapperFactoryBean` para cada interfaz encontrado.

src/site/ja/markdown/mappers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ XML 設定の例:
139139

140140
検出された Mapper は、Spring の自動検出コンポーネントに対するデフォルト命名規則によって Bean 名が決められます[the Spring reference document(Core Technologies -Naming autodetected components-](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-scanning-name-generator) を参照してください。
141141
アノテーションによる指定がない場合はクラス名の先頭を小文字にした文字列が Bean 名となりますが、`@Component` あるいは JSR-330 の `@Named` アノテーションを使って Bean 名を明示的に指定することもできます。
142-
先に説明した `annotation` 属性で `org.springframework.stereotype.Component``javax.inject.Named`Java 6 以降を利用している場合のみ)を指定すれば、検出時のマーカーと Bean 名の指定を1つのアノテーションで兼ねることができます。
142+
先に説明した `annotation` 属性で `org.springframework.stereotype.Component``jakarta.inject.Named`Jakarta EE 以降を利用している場合のみ)を指定すれば、検出時のマーカーと Bean 名の指定を1つのアノテーションで兼ねることができます。
143143
同じ目的で独自に定義したアノテーションを使うこともできますが、このアノテーション自体に `@Component``@Named` を付加しておく必要があります。
144144

145145
<span class="label important">NOTE</span>

src/site/ko/markdown/mappers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ The `default-scope` apply to the mapper bean(`MapperFactoryBean`) when scope of
136136

137137
발견된 매퍼는 자동검색된 컴포넌트를 위한 스프링의 디폴트 명명규칙 전략(see [the Spring reference document(Core Technologies -Naming autodetected components-)](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-scanning-name-generator) 을 사용해서 빈이름이 명명된다.
138138
빈 이름을 정하는 애노테이션이 없다면 매퍼의 이름에서 첫글자를 소문자로 변환한 형태로 빈 이름을 사용할 것이다. `@Component` 나 JSR-330의 `@Named` 애노테이션이 있다면 애노테이션에 정의한 이름을 그대로 사용할 것이다.
139-
`annotation` 프로퍼티를 `org.springframework.stereotype.Component`, `javax.inject.Named`(자바SE 1.6을 사용한다면) 또는 개발자가 스스로 작성한 애노테이션으로 셋팅할 수 있다.
139+
`annotation` 프로퍼티를 `org.springframework.stereotype.Component`, `jakarta.inject.Named`(Jakarta EE을 사용한다면) 또는 개발자가 스스로 작성한 애노테이션으로 셋팅할 수 있다.
140140
그러면 애노테이션은 마커와 이름을 제공하는 역할로 동작할 것이다.
141141

142142
<span class="label important">중요</span>

src/site/markdown/mappers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ By default, these two properties are null, so all interfaces in the given base p
135135

136136
Discovered mappers will be named using Spring default naming strategy for autodetected components (see [the Spring reference document(Core Technologies -Naming autodetected components-)](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-scanning-name-generator)).
137137
That is, if no annotation is found, it will use the uncapitalized non-qualified class name of the mapper. But if either a `@Component` or a JSR-330 `@Named` annotation is found it will get the name from the annotation.
138-
Notice that you can set the `annotation` attribute to `org.springframework.stereotype.Component`, `javax.inject.Named` (if you have JSE 6) or to your own annotation (that must be itself annotated) so the annotation will work both as a marker and as a name provider.
138+
Notice that you can set the `annotation` attribute to `org.springframework.stereotype.Component`, `jakarta.inject.Named` (if you have JakartaEE) or to your own annotation (that must be itself annotated) so the annotation will work both as a marker and as a name provider.
139139

140140
<span class="label important">NOTE</span>
141141
`<context:component-scan/>` won't be able to scan and register mappers. Mappers are interfaces and, in order to register them to Spring, the scanner must know how to create a `MapperFactoryBean` for each interface it finds.

src/site/zh_CN/markdown/mappers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public interface GoodsMapper {
137137

138138
被发现的映射器会按照 Spring 对自动发现组件的默认命名策略进行命名(参考 [the Spring reference document(Core Technologies -Naming autodetected components-)](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-scanning-name-generator) )。
139139
也就是说,如果没有使用注解显式指定名称,将会使用映射器的首字母小写非全限定类名作为名称。但如果发现映射器具有 `@Component` 或 JSR-330 标准中 `@Named` 注解,会使用注解中的名称作为名称。
140-
提醒一下,你可以设置 `annotation` 属性为你自定义的注解,然后在你的注解上设置 `org.springframework.stereotype.Component``javax.inject.Named`(需要使用 Java SE 6 以上)注解,这样你的注解既可以作为标记,也可以作为一个名字提供器来使用了。
140+
提醒一下,你可以设置 `annotation` 属性为你自定义的注解,然后在你的注解上设置 `org.springframework.stereotype.Component``jakarta.inject.Named`(需要使用 Jakarta EE 以上)注解,这样你的注解既可以作为标记,也可以作为一个名字提供器来使用了。
141141

142142
<span class="label important">提示</span>
143143
`<context:component-scan/>` 无法发现并注册映射器。映射器的本质是接口,为了将它们注册到 Spring 中,发现器必须知道如何为找到的每个接口创建一个 `MapperFactoryBean`

src/test/java/org/mybatis/spring/SqlSessionFactoryBeanTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2023 the original author or authors.
2+
* Copyright 2010-2024 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.
@@ -67,6 +67,7 @@
6767
import org.mybatis.spring.type.SuperType;
6868
import org.mybatis.spring.type.TypeHandlerFactory;
6969
import org.springframework.core.io.ClassPathResource;
70+
import org.springframework.core.io.Resource;
7071

7172
class SqlSessionFactoryBeanTest {
7273

@@ -274,8 +275,7 @@ void testNullConfigLocation() throws Exception {
274275
void testSetConfigLocation() throws Exception {
275276
setupFactoryBean();
276277

277-
factoryBean
278-
.setConfigLocation(new org.springframework.core.io.ClassPathResource("org/mybatis/spring/mybatis-config.xml"));
278+
factoryBean.setConfigLocation(new ClassPathResource("org/mybatis/spring/mybatis-config.xml"));
279279

280280
SqlSessionFactory factory = factoryBean.getObject();
281281

@@ -304,8 +304,7 @@ void testSpecifyConfigurationAndConfigLocation() throws Exception {
304304
setupFactoryBean();
305305

306306
factoryBean.setConfiguration(new Configuration());
307-
factoryBean
308-
.setConfigLocation(new org.springframework.core.io.ClassPathResource("org/mybatis/spring/mybatis-config.xml"));
307+
factoryBean.setConfigLocation(new ClassPathResource("org/mybatis/spring/mybatis-config.xml"));
309308

310309
Throwable e = assertThrows(IllegalStateException.class, factoryBean::getObject);
311310
assertThat(e.getMessage())
@@ -344,7 +343,7 @@ void testEmptyMapperLocations() throws Exception {
344343
@Test
345344
void testMapperLocationsWithNullEntry() throws Exception {
346345
setupFactoryBean();
347-
factoryBean.setMapperLocations(new org.springframework.core.io.Resource[] { null });
346+
factoryBean.setMapperLocations(new Resource[] { null });
348347

349348
assertDefaultConfig(factoryBean.getObject());
350349
}

src/test/java/org/mybatis/spring/submitted/webapp_placeholder/WebappPlaceholderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2022 the original author or authors.
2+
* Copyright 2010-2024 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.
@@ -29,7 +29,7 @@
2929

3030
@ExtendWith(SpringExtension.class)
3131
@WebAppConfiguration
32-
@SpringJUnitConfig(locations = "file:src/test/java/org/mybatis/spring/submitted/webapp_placeholder/spring.xml")
32+
@SpringJUnitConfig(locations = "classpath:org/mybatis/spring/submitted/webapp_placeholder/spring.xml")
3333
class WebappPlaceholderTest {
3434

3535
@Autowired

src/test/java/org/mybatis/spring/TestMapper.xml renamed to src/test/resources/org/mybatis/spring/TestMapper.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright 2010-2022 the original author or authors.
4+
Copyright 2010-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.

src/test/java/org/mybatis/spring/TestMapper2.xml renamed to src/test/resources/org/mybatis/spring/TestMapper2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright 2010-2023 the original author or authors.
4+
Copyright 2010-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)