Skip to content

Commit 4ba9fb5

Browse files
authored
Merge pull request #2408 from hazendaz/master
Update jdks, update maven wrapper, and update few test libraries missed by dependabot
2 parents 6490a16 + c979ccf commit 4ba9fb5

File tree

8 files changed

+141
-88
lines changed

8 files changed

+141
-88
lines changed

.github/workflows/coveralls.yaml

+1-1
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

+1-1
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

+1-1
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/wrapper/MavenWrapperDownloader.java

+88-63
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

+18-2
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

+12-6
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 "$@"

mvnw.cmd

+18-12
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
4646
@REM Execute a user defined script before this one
4747
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
4848
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
49-
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50-
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
49+
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
50+
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
5151
:skipRcPre
5252

5353
@setlocal
@@ -120,9 +120,9 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120120
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121121
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122122

123-
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
123+
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
124124

125-
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
125+
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126126
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127127
)
128128

@@ -134,7 +134,7 @@ if exist %WRAPPER_JAR% (
134134
)
135135
) else (
136136
if not "%MVNW_REPOURL%" == "" (
137-
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
137+
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
138138
)
139139
if "%MVNW_VERBOSE%" == "true" (
140140
echo Couldn't find %WRAPPER_JAR%, downloading it ...
@@ -158,7 +158,13 @@ if exist %WRAPPER_JAR% (
158158
@REM work with both Windows and non-Windows executions.
159159
set MAVEN_CMD_LINE_ARGS=%*
160160

161-
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
161+
%MAVEN_JAVA_EXE% ^
162+
%JVM_CONFIG_MAVEN_PROPS% ^
163+
%MAVEN_OPTS% ^
164+
%MAVEN_DEBUG_OPTS% ^
165+
-classpath %WRAPPER_JAR% ^
166+
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
167+
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
162168
if ERRORLEVEL 1 goto error
163169
goto end
164170

@@ -168,15 +174,15 @@ set ERROR_CODE=1
168174
:end
169175
@endlocal & set ERROR_CODE=%ERROR_CODE%
170176

171-
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
177+
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
172178
@REM check for post script, once with legacy .bat ending and once with .cmd ending
173-
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
174-
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
179+
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
180+
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
175181
:skipRcPost
176182

177183
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
178-
if "%MAVEN_BATCH_PAUSE%" == "on" pause
184+
if "%MAVEN_BATCH_PAUSE%"=="on" pause
179185

180-
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
186+
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
181187

182-
exit /B %ERROR_CODE%
188+
cmd /C exit /B %ERROR_CODE%

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
<dependency>
198198
<groupId>org.hsqldb</groupId>
199199
<artifactId>hsqldb</artifactId>
200-
<version>2.5.1</version>
200+
<version>2.5.2</version>
201201
<scope>test</scope>
202202
</dependency>
203203
<dependency> <!-- 10.15+ need Java 9+ -->
@@ -277,7 +277,7 @@
277277
<dependency>
278278
<groupId>com.microsoft.sqlserver</groupId>
279279
<artifactId>mssql-jdbc</artifactId>
280-
<version>9.4.0.jre8</version>
280+
<version>9.4.1.jre8</version>
281281
<scope>provided</scope>
282282
</dependency>
283283
<dependency>

0 commit comments

Comments
 (0)