Skip to content

Commit b28588e

Browse files
committed
Merge branch 'master' into pr/3146
2 parents 4a9d42c + 8ac3920 commit b28588e

File tree

577 files changed

+10650
-2732
lines changed

Some content is hidden

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

577 files changed

+10650
-2732
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,30 @@
11
name: Java CI
22

3-
on: [push, pull_request]
3+
on: [workflow_dispatch, push, pull_request]
44

55
jobs:
66
test:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10+
cache: [maven]
11+
distribution: [temurin]
12+
java: [17, 21, 23, 24-ea, 25-ea]
1013
os: [ubuntu-latest, macos-latest, windows-latest]
11-
java: [11, 17, 21, 22, 23-ea]
12-
distribution: ['temurin']
1314
fail-fast: false
1415
max-parallel: 4
1516
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
1617

1718
steps:
1819
- uses: actions/checkout@v4
19-
- name: Set up JDK
20+
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
2021
uses: actions/setup-java@v4
2122
with:
22-
java-version: ${{ matrix.java }}
23+
cache: ${{ matrix.cache }}
2324
distribution: ${{ matrix.distribution }}
24-
- name: Print JDK Version
25-
run: java -version
26-
- name: Cache local Maven m2
27-
uses: actions/cache@v4
28-
with:
29-
path: ~/.m2
30-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31-
restore-keys: |
32-
${{ runner.os }}-m2
33-
- name: Set argLine command line option
34-
if: ${{ matrix.java == '11' }}
35-
run: echo 'ARG_LINE=-D"argLine=--illegal-access=permit"' >> $GITHUB_ENV
36-
- name: Run all tests
37-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java == '11' }}
38-
run: echo 'ARG_LINE=-D"excludedGroups="' >> $GITHUB_ENV
39-
- name: Skip tests that require illegal reflective access
40-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java != '11' }}
41-
run: echo 'ARG_LINE=-D"excludedGroups=RequireIllegalAccess"' >> $GITHUB_ENV
42-
- name: Skip tests that require illegal reflective access
43-
if: ${{ matrix.os != 'ubuntu-latest' && matrix.java != '11' }}
44-
run: echo 'ARG_LINE=-D"excludedGroups=TestcontainersTests,RequireIllegalAccess"' >> $GITHUB_ENV
45-
- name: Active Profiles
46-
run: ./mvnw help:active-profiles
47-
- name: Test with Maven
48-
if: ${{ matrix.os != 'windows-latest' }}
49-
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" $ARG_LINE
50-
- name: Test with Maven
51-
if: ${{ matrix.os == 'windows-latest' && matrix.java == '11' }}
52-
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" -D"argLine=--illegal-access=permit"
25+
java-version: ${{ matrix.java }}
26+
- name: Setup testContainers profile for ubuntu
27+
if: ${{ matrix.os == 'ubuntu-latest' }}
28+
run: echo 'TEST_CONTAINERS_PROFILE=-PtestContainers' >> $GITHUB_ENV
5329
- name: Test with Maven
54-
if: ${{ matrix.os == 'windows-latest' && matrix.java != '11' }}
55-
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" -D"excludedGroups=TestcontainersTests,RequireIllegalAccess"
30+
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" $TEST_CONTAINERS_PROFILE

.github/workflows/codeql.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ jobs:
5050
- name: Checkout repository
5151
uses: actions/checkout@v4
5252

53+
- name: Setup Java
54+
uses: actions/setup-java@v4
55+
with:
56+
java-version: 17
57+
distribution: 'temurin'
58+
5359
# Initializes the CodeQL tools for scanning.
5460
- name: Initialize CodeQL
5561
uses: github/codeql-action/init@v3

.github/workflows/coveralls.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ jobs:
1111
- name: Set up JDK
1212
uses: actions/setup-java@v4
1313
with:
14+
cache: maven
15+
distribution: temurin
1416
java-version: 21
15-
distribution: zulu
1617
- name: Report Coverage to Coveralls for Pull Requests
1718
if: github.event_name == 'pull_request'
18-
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER
19+
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER --no-transfer-progress
1920
env:
2021
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2122
PR_NUMBER: ${{ github.event.number }}
2223
- name: Report Coverage to Coveralls for General Push
2324
if: github.event_name == 'push'
24-
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github
25+
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github --no-transfer-progress
2526
env:
2627
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/site.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,25 @@ on:
77

88
jobs:
99
build:
10-
if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]')
10+
if: github.repository_owner == 'mybatis' && contains(toJSON(github.event.head_commit.message), '[maven-release-plugin] prepare release')
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Set up JDK
1515
uses: actions/setup-java@v4
1616
with:
17+
cache: maven
18+
distribution: temurin
1719
java-version: 21
18-
distribution: zulu
19-
- uses: webfactory/ssh-agent@master
20-
with:
21-
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
2220
- name: Build site
23-
run: ./mvnw site site:stage -DskipTests -B -V --no-transfer-progress -Dlicense.skip=true
21+
run: ./mvnw site site:stage -DskipTests -Dlicense.skip=true -B -V --no-transfer-progress --settings ./.mvn/settings.xml
2422
env:
2523
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
2624
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
2726
- name: Deploy Site to gh-pages
28-
uses: JamesIves/github-pages-deploy-action@v4.5.0
27+
uses: JamesIves/github-pages-deploy-action@v4
2928
with:
30-
ssh-key: true
3129
branch: gh-pages
3230
folder: target/staging
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
ssh-key: ${{ secrets.DEPLOY_KEY }}

.github/workflows/sonar.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ jobs:
1717
- name: Set up JDK
1818
uses: actions/setup-java@v4
1919
with:
20+
cache: maven
21+
distribution: temurin
2022
java-version: 21
21-
distribution: zulu
2223
- name: Analyze with SonarCloud
23-
run: ./mvnw verify jacoco:report sonar:sonar -B -Dsonar.projectKey=mybatis_mybatis-3 -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN -Dlicense.skip=true --no-transfer-progress
24+
run: ./mvnw verify jacoco:report sonar:sonar -B -V -Dsonar.projectKey=mybatis_mybatis-3 -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN -Dlicense.skip=true --no-transfer-progress
2425
env:
2526
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2627
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/sonatype.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ jobs:
1414
- name: Set up JDK
1515
uses: actions/setup-java@v4
1616
with:
17+
cache: maven
18+
distribution: temurin
1719
java-version: 21
18-
distribution: zulu
1920
- name: Deploy to Sonatype
2021
run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true -Prelease -Dgpg.skip
2122
env:

.mvn/extensions.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 2009-2023 the original author or authors.
4+
Copyright 2009-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.

.mvn/settings.xml

Lines changed: 13 additions & 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 2009-2023 the original author or authors.
4+
Copyright 2009-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.
@@ -18,12 +18,15 @@
1818
-->
1919
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2020
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
21+
2122
<servers>
23+
<!-- Used for sonatype snapshots and releases -->
2224
<server>
2325
<id>ossrh</id>
2426
<username>${env.CI_DEPLOY_USERNAME}</username>
2527
<password>${env.CI_DEPLOY_PASSWORD}</password>
2628
</server>
29+
2730
<!-- Used for gh-pages-scm publish via maven-scm-publish-plugin -->
2831
<server>
2932
<id>gh-pages-scm</id>
@@ -32,10 +35,19 @@
3235
<scmVersion>gh-pages</scmVersion>
3336
</configuration>
3437
</server>
38+
39+
<!-- Github deployments (site) -->
3540
<server>
3641
<id>github</id>
3742
<username>${env.CI_DEPLOY_USERNAME}</username>
3843
<password>${env.GITHUB_TOKEN}</password>
3944
</server>
45+
46+
<!-- NVD API Access (dependency-check-plugin) -->
47+
<server>
48+
<id>nvd</id>
49+
<password>${env.NVD_API_KEY}</password>
50+
</server>
4051
</servers>
52+
4153
</settings>

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21,77 +21,72 @@
2121
import java.io.InputStream;
2222
import java.net.Authenticator;
2323
import java.net.PasswordAuthentication;
24+
import java.net.URI;
2425
import java.net.URL;
2526
import java.nio.file.Files;
2627
import java.nio.file.Path;
2728
import java.nio.file.Paths;
2829
import java.nio.file.StandardCopyOption;
30+
import java.util.concurrent.ThreadLocalRandom;
2931

30-
public final class MavenWrapperDownloader
31-
{
32-
private static final String WRAPPER_VERSION = "3.2.0";
32+
public final class MavenWrapperDownloader {
33+
private static final String WRAPPER_VERSION = "3.3.2";
3334

34-
private static final boolean VERBOSE = Boolean.parseBoolean( System.getenv( "MVNW_VERBOSE" ) );
35+
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE"));
3536

36-
public static void main( String[] args )
37-
{
38-
log( "Apache Maven Wrapper Downloader " + WRAPPER_VERSION );
37+
public static void main(String[] args) {
38+
log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION);
3939

40-
if ( args.length != 2 )
41-
{
42-
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
43-
System.exit( 1 );
40+
if (args.length != 2) {
41+
System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing");
42+
System.exit(1);
4443
}
4544

46-
try
47-
{
48-
log( " - Downloader started" );
49-
final URL wrapperUrl = new URL( args[0] );
50-
final String jarPath = args[1].replace( "..", "" ); // Sanitize path
51-
final Path wrapperJarPath = Paths.get( jarPath ).toAbsolutePath().normalize();
52-
downloadFileFromURL( wrapperUrl, wrapperJarPath );
53-
log( "Done" );
54-
}
55-
catch ( IOException e )
56-
{
57-
System.err.println( "- Error downloading: " + e.getMessage() );
58-
if ( VERBOSE )
59-
{
45+
try {
46+
log(" - Downloader started");
47+
final URL wrapperUrl = URI.create(args[0]).toURL();
48+
final String jarPath = args[1].replace("..", ""); // Sanitize path
49+
final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize();
50+
downloadFileFromURL(wrapperUrl, wrapperJarPath);
51+
log("Done");
52+
} catch (IOException e) {
53+
System.err.println("- Error downloading: " + e.getMessage());
54+
if (VERBOSE) {
6055
e.printStackTrace();
6156
}
62-
System.exit( 1 );
57+
System.exit(1);
6358
}
6459
}
6560

66-
private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
67-
throws IOException
68-
{
69-
log( " - Downloading to: " + wrapperJarPath );
70-
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
71-
{
72-
final String username = System.getenv( "MVNW_USERNAME" );
73-
final char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
74-
Authenticator.setDefault( new Authenticator()
75-
{
61+
private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath)
62+
throws IOException {
63+
log(" - Downloading to: " + wrapperJarPath);
64+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
65+
final String username = System.getenv("MVNW_USERNAME");
66+
final char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
67+
Authenticator.setDefault(new Authenticator() {
7668
@Override
77-
protected PasswordAuthentication getPasswordAuthentication()
78-
{
79-
return new PasswordAuthentication( username, password );
69+
protected PasswordAuthentication getPasswordAuthentication() {
70+
return new PasswordAuthentication(username, password);
8071
}
81-
} );
72+
});
8273
}
83-
try ( InputStream inStream = wrapperUrl.openStream() )
84-
{
85-
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
74+
Path temp = wrapperJarPath
75+
.getParent()
76+
.resolve(wrapperJarPath.getFileName() + "."
77+
+ Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp");
78+
try (InputStream inStream = wrapperUrl.openStream()) {
79+
Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING);
80+
Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING);
81+
} finally {
82+
Files.deleteIfExists(temp);
8683
}
87-
log( " - Downloader complete" );
84+
log(" - Downloader complete");
8885
}
8986

90-
private static void log( String msg )
91-
{
92-
if ( VERBOSE )
93-
{
94-
System.out.println( msg );
87+
private static void log(String msg) {
88+
if (VERBOSE) {
89+
System.out.println(msg);
9590
}
9691
}
9792

.mvn/wrapper/maven-wrapper.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
17+
wrapperVersion=3.3.2
18+
distributionType=source
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

ICLA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MyBatis
22
Individual Contributor License Agreement ("Agreement") V2.0
3-
https://mybatis.googlecode.com/svn/trunk/ICLA
3+
https://github.com/mybatis/mybatis-3/edit/master/ICLA
44

55
Thank you for your interest in MyBatis (the
66
"Project"). In order to clarify the intellectual property license

0 commit comments

Comments
 (0)