Skip to content

Commit e883acc

Browse files
committed
Merge branch 'master' into arg-name-based-constructor-automapping
# Conflicts: # src/main/java/org/apache/ibatis/session/Configuration.java # src/site/es/xdoc/configuration.xml # src/site/ja/xdoc/configuration.xml # src/site/ko/xdoc/configuration.xml # src/site/xdoc/configuration.xml # src/site/zh/xdoc/configuration.xml
2 parents 5a5a6b9 + 0ccf9ba commit e883acc

Some content is hidden

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

58 files changed

+1507
-415
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
strategy:
2525
matrix:
2626
os: [ubuntu-latest, macOS-latest, windows-latest]
27-
java: [8, 11, 16, 17-ea]
28-
distribution: ['adopt']
27+
java: [8, 11, 17, 18-ea, 19-ea]
28+
distribution: ['zulu']
2929
fail-fast: false
3030
max-parallel: 4
3131
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
@@ -45,17 +45,26 @@ jobs:
4545
restore-keys: |
4646
${{ runner.os }}-m2
4747
- name: Set argLine command line option
48-
if: ${{ matrix.java != '8' }}
48+
if: ${{ matrix.java == '11' }}
4949
run: echo 'ARG_LINE=-D"argLine=--illegal-access=permit"' >> $GITHUB_ENV
50+
- name: Skip tests that require illegal reflective access
51+
if: ${{ matrix.os == 'ubuntu-latest' && (matrix.java != '8' && matrix.java != '11' )}}
52+
run: echo 'ARG_LINE=-D"excludedGroups=RequireIllegalAccess"' >> $GITHUB_ENV
53+
- name: Skip tests that require illegal reflective access
54+
if: ${{ matrix.os != 'ubuntu-latest' && (matrix.java != '8' && matrix.java != '11' )}}
55+
run: echo 'ARG_LINE=-D"excludedGroups=TestcontainersTests,RequireIllegalAccess"' >> $GITHUB_ENV
5056
- name: Set env command line option
5157
if: ${{ matrix.os == 'ubuntu-latest' }}
52-
run: echo 'ENV_TRAVIS="-Denv.TRAVIS"' >> $GITHUB_ENV
58+
run: echo 'ENV_GITHUB="-Denv.GITHUB"' >> $GITHUB_ENV
5359
- name: Test with Maven
5460
if: ${{ matrix.os != 'windows-latest' }}
55-
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" $ENV_TRAVIS $ARG_LINE
61+
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" $ENV_GITHUB $ARG_LINE
5662
- name: Test with Maven
57-
if: ${{ matrix.os == 'windows-latest' && matrix.java == '8' }}
63+
if: ${{ matrix.os == 'windows-latest' && (matrix.java == '8')}}
5864
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true"
5965
- name: Test with Maven
60-
if: ${{ matrix.os == 'windows-latest' && matrix.java != '8' }}
66+
if: ${{ matrix.os == 'windows-latest' && (matrix.java == '11') }}
6167
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" -D"argLine=--illegal-access=permit"
68+
- name: Test with Maven
69+
if: ${{ matrix.os == 'windows-latest' && (matrix.java != '8' && matrix.java != '11') }}
70+
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" -D"excludedGroups=TestcontainersTests,RequireIllegalAccess"

.github/workflows/coveralls.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/setup-java@v2
2929
with:
3030
java-version: 8
31-
distribution: adopt
31+
distribution: zulu
3232
- name: Report Coverage to Coveralls for Pull Requests
3333
if: github.event_name == 'pull_request'
3434
run: ./mvnw test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER

.github/workflows/sonar.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/setup-java@v2
3535
with:
3636
java-version: 11
37-
distribution: adopt
37+
distribution: zulu
3838
- name: Analyze with SonarCloud
3939
run: ./mvnw verify jacoco:report sonar:sonar -B -Dsonar.projectKey=mybatis_mybatis-3 -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dlicense.skip=true
4040
env:

.github/workflows/sonatype.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/setup-java@v2
3232
with:
3333
java-version: 11
34-
distribution: adopt
34+
distribution: zulu
3535
- name: Deploy to Sonatype
3636
run: ./mvnw deploy -DskipTests -B --settings ./.mvn/settings.xml -Dlicense.skip=true
3737
env:

.mvn/extensions.xml

Lines changed: 2 additions & 2 deletions
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-2020 the original author or authors.
4+
Copyright 2009-2022 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.
@@ -20,6 +20,6 @@
2020
<extension>
2121
<groupId>fr.jcgay.maven</groupId>
2222
<artifactId>maven-profiler</artifactId>
23-
<version>3.1.1</version>
23+
<version>3.2</version>
2424
</extension>
2525
</extensions>

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 88 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,140 @@
11
/*
2-
* Copyright 2007-present the original author or authors.
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
39
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
10+
* http://www.apache.org/licenses/LICENSE-2.0
711
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
1518
*/
19+
1620
import java.net.*;
1721
import java.io.*;
1822
import java.nio.channels.*;
1923
import java.util.Properties;
2024

21-
public class MavenWrapperDownloader {
25+
public class MavenWrapperDownloader
26+
{
27+
private static final String WRAPPER_VERSION = "3.1.0";
2228

23-
private static final String WRAPPER_VERSION = "0.5.6";
2429
/**
2530
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
2631
*/
27-
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28-
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
32+
private static final String DEFAULT_DOWNLOAD_URL =
33+
"https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/" + WRAPPER_VERSION
34+
+ "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
2935

3036
/**
31-
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32-
* use instead of the default one.
37+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use instead of the
38+
* default one.
3339
*/
34-
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35-
".mvn/wrapper/maven-wrapper.properties";
40+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties";
3641

3742
/**
3843
* Path where the maven-wrapper.jar will be saved to.
3944
*/
40-
private static final String MAVEN_WRAPPER_JAR_PATH =
41-
".mvn/wrapper/maven-wrapper.jar";
45+
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";
4246

4347
/**
4448
* Name of the property which should be used to override the default download url for the wrapper.
4549
*/
4650
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
4751

48-
public static void main(String args[]) {
49-
System.out.println("- Downloader started");
50-
File baseDirectory = new File(args[0]);
51-
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52+
public static void main( String args[] )
53+
{
54+
System.out.println( "- Downloader started" );
55+
File baseDirectory = new File( args[0] );
56+
System.out.println( "- Using base directory: " + baseDirectory.getAbsolutePath() );
5257

5358
// If the maven-wrapper.properties exists, read it and check if it contains a custom
5459
// wrapperUrl parameter.
55-
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
60+
File mavenWrapperPropertyFile = new File( baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH );
5661
String url = DEFAULT_DOWNLOAD_URL;
57-
if(mavenWrapperPropertyFile.exists()) {
62+
if ( mavenWrapperPropertyFile.exists() )
63+
{
5864
FileInputStream mavenWrapperPropertyFileInputStream = null;
59-
try {
60-
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
65+
try
66+
{
67+
mavenWrapperPropertyFileInputStream = new FileInputStream( mavenWrapperPropertyFile );
6168
Properties mavenWrapperProperties = new Properties();
62-
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63-
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64-
} catch (IOException e) {
65-
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66-
} finally {
67-
try {
68-
if(mavenWrapperPropertyFileInputStream != null) {
69+
mavenWrapperProperties.load( mavenWrapperPropertyFileInputStream );
70+
url = mavenWrapperProperties.getProperty( PROPERTY_NAME_WRAPPER_URL, url );
71+
}
72+
catch ( IOException e )
73+
{
74+
System.out.println( "- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'" );
75+
}
76+
finally
77+
{
78+
try
79+
{
80+
if ( mavenWrapperPropertyFileInputStream != null )
81+
{
6982
mavenWrapperPropertyFileInputStream.close();
7083
}
71-
} catch (IOException e) {
84+
}
85+
catch ( IOException e )
86+
{
7287
// Ignore ...
7388
}
7489
}
7590
}
76-
System.out.println("- Downloading from: " + url);
91+
System.out.println( "- Downloading from: " + url );
7792

78-
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79-
if(!outputFile.getParentFile().exists()) {
80-
if(!outputFile.getParentFile().mkdirs()) {
81-
System.out.println(
82-
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
93+
File outputFile = new File( baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH );
94+
if ( !outputFile.getParentFile().exists() )
95+
{
96+
if ( !outputFile.getParentFile().mkdirs() )
97+
{
98+
System.out.println( "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath()
99+
+ "'" );
83100
}
84101
}
85-
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86-
try {
87-
downloadFileFromURL(url, outputFile);
88-
System.out.println("Done");
89-
System.exit(0);
90-
} catch (Throwable e) {
91-
System.out.println("- Error downloading");
102+
System.out.println( "- Downloading to: " + outputFile.getAbsolutePath() );
103+
try
104+
{
105+
downloadFileFromURL( url, outputFile );
106+
System.out.println( "Done" );
107+
System.exit( 0 );
108+
}
109+
catch ( Throwable e )
110+
{
111+
System.out.println( "- Error downloading" );
92112
e.printStackTrace();
93-
System.exit(1);
113+
System.exit( 1 );
94114
}
95115
}
96116

97-
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98-
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99-
String username = System.getenv("MVNW_USERNAME");
100-
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101-
Authenticator.setDefault(new Authenticator() {
117+
private static void downloadFileFromURL( String urlString, File destination )
118+
throws Exception
119+
{
120+
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
121+
{
122+
String username = System.getenv( "MVNW_USERNAME" );
123+
char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
124+
Authenticator.setDefault( new Authenticator()
125+
{
102126
@Override
103-
protected PasswordAuthentication getPasswordAuthentication() {
104-
return new PasswordAuthentication(username, password);
127+
protected PasswordAuthentication getPasswordAuthentication()
128+
{
129+
return new PasswordAuthentication( username, password );
105130
}
106-
});
131+
} );
107132
}
108-
URL website = new URL(urlString);
133+
URL website = new URL( urlString );
109134
ReadableByteChannel rbc;
110-
rbc = Channels.newChannel(website.openStream());
111-
FileOutputStream fos = new FileOutputStream(destination);
112-
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
135+
rbc = Channels.newChannel( website.openStream() );
136+
FileOutputStream fos = new FileOutputStream( destination );
137+
fos.getChannel().transferFrom( rbc, 0, Long.MAX_VALUE );
113138
fos.close();
114139
rbc.close();
115140
}

.mvn/wrapper/maven-wrapper.properties

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
2-
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

mvnw

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636

3737
if [ -z "$MAVEN_SKIP_RC" ] ; then
3838

39+
if [ -f /usr/local/etc/mavenrc ] ; then
40+
. /usr/local/etc/mavenrc
41+
fi
42+
3943
if [ -f /etc/mavenrc ] ; then
4044
. /etc/mavenrc
4145
fi
@@ -145,7 +149,7 @@ if [ -z "$JAVACMD" ] ; then
145149
JAVACMD="$JAVA_HOME/bin/java"
146150
fi
147151
else
148-
JAVACMD="`which java`"
152+
JAVACMD="`\\unset -f command; \\command -v java`"
149153
fi
150154
fi
151155

@@ -212,9 +216,9 @@ else
212216
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
213217
fi
214218
if [ -n "$MVNW_REPOURL" ]; then
215-
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
219+
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
216220
else
217-
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
221+
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
218222
fi
219223
while IFS="=" read key value; do
220224
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
@@ -233,9 +237,9 @@ else
233237
echo "Found wget ... using wget"
234238
fi
235239
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
236-
wget "$jarUrl" -O "$wrapperJarPath"
240+
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
237241
else
238-
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
242+
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
239243
fi
240244
elif command -v curl > /dev/null; then
241245
if [ "$MVNW_VERBOSE" = true ]; then
@@ -305,6 +309,8 @@ WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
305309

306310
exec "$JAVACMD" \
307311
$MAVEN_OPTS \
312+
$MAVEN_DEBUG_OPTS \
308313
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
309-
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
314+
"-Dmaven.home=${M2_HOME}" \
315+
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
310316
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

0 commit comments

Comments
 (0)