Skip to content

Commit ead5a1d

Browse files
authored
Merge pull request #2944 from hazendaz/copyright
Update maven and github actions
2 parents 06d5936 + 15d78e3 commit ead5a1d

11 files changed

+40
-99
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ jobs:
5353
run: ./mvnw help:active-profiles
5454
- name: Test with Maven
5555
if: ${{ matrix.os != 'windows-latest' }}
56-
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" $ARG_LINE
56+
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" $ARG_LINE
5757
- name: Test with Maven
5858
if: ${{ matrix.os == 'windows-latest' && matrix.java == '11' }}
59-
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" -D"argLine=--illegal-access=permit"
59+
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" -D"argLine=--illegal-access=permit"
6060
- name: Test with Maven
6161
if: ${{ matrix.os == 'windows-latest' && matrix.java != '11' }}
62-
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" -D"excludedGroups=TestcontainersTests,RequireIllegalAccess"
62+
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" -D"excludedGroups=TestcontainersTests,RequireIllegalAccess"

.github/workflows/coveralls.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
- name: Set up JDK
1212
uses: actions/setup-java@v3
1313
with:
14-
java-version: 11
14+
java-version: 17
1515
distribution: zulu
1616
- name: Report Coverage to Coveralls for Pull Requests
1717
if: github.event_name == 'pull_request'
18-
run: ./mvnw test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER
18+
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2121
PR_NUMBER: ${{ github.event.number }}
2222
- name: Report Coverage to Coveralls for General Push
2323
if: github.event_name == 'push'
24-
run: ./mvnw test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github
24+
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github
2525
env:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sonar.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
java-version: 17
2121
distribution: zulu
2222
- 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.login=$SONAR_TOKEN -Dlicense.skip=true
23+
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 --no-transfer-progress
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2626
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/sonatype.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
java-version: 17
1818
distribution: zulu
1919
- name: Deploy to Sonatype
20-
run: ./mvnw deploy -DskipTests -B --settings ./.mvn/settings.xml -Dlicense.skip=true
20+
run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true
2121
env:
2222
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
2323
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5
2-
--no-transfer-progress
2+
-Daether.connector.smartChecksums=false

.mvn/settings.xml

Lines changed: 7 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-2022 the original author or authors.
4+
Copyright 2009-2023 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.
@@ -24,8 +24,13 @@
2424
<username>${env.CI_DEPLOY_USERNAME}</username>
2525
<password>${env.CI_DEPLOY_PASSWORD}</password>
2626
</server>
27+
<!-- Used for gh-pages-scm publish via maven-scm-publish-plugin -->
2728
<server>
28-
<id>gh-pages</id>
29+
<id>gh-pages-scm</id>
30+
<configuration>
31+
<scmVersionType>branch</scmVersionType>
32+
<scmVersion>gh-pages</scmVersion>
33+
</configuration>
2934
</server>
3035
<server>
3136
<id>github</id>

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 20 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -23,85 +23,50 @@
2323
import java.net.PasswordAuthentication;
2424
import java.net.URL;
2525
import java.nio.file.Files;
26-
import java.nio.file.LinkOption;
2726
import java.nio.file.Path;
2827
import java.nio.file.Paths;
2928
import java.nio.file.StandardCopyOption;
30-
import java.nio.file.StandardOpenOption;
31-
import java.util.Properties;
3229

3330
public final class MavenWrapperDownloader
3431
{
35-
private static final String WRAPPER_VERSION = "3.1.1";
32+
private static final String WRAPPER_VERSION = "3.2.0";
3633

3734
private static final boolean VERBOSE = Boolean.parseBoolean( System.getenv( "MVNW_VERBOSE" ) );
3835

39-
/**
40-
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
41-
*/
42-
private static final String DEFAULT_DOWNLOAD_URL =
43-
"https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/" + WRAPPER_VERSION
44-
+ "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
45-
46-
/**
47-
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use instead of the
48-
* default one.
49-
*/
50-
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties";
51-
52-
/**
53-
* Path where the maven-wrapper.jar will be saved to.
54-
*/
55-
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";
56-
57-
/**
58-
* Name of the property which should be used to override the default download url for the wrapper.
59-
*/
60-
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
61-
6236
public static void main( String[] args )
6337
{
64-
if ( args.length == 0 )
65-
{
66-
System.err.println( " - ERROR projectBasedir parameter missing" );
67-
System.exit( 1 );
68-
}
38+
log( "Apache Maven Wrapper Downloader " + WRAPPER_VERSION );
6939

70-
log( " - Downloader started" );
71-
final String dir = args[0].replace( "..", "" ); // Sanitize path
72-
final Path projectBasedir = Paths.get( dir ).toAbsolutePath().normalize();
73-
if ( !Files.isDirectory( projectBasedir, LinkOption.NOFOLLOW_LINKS ) )
40+
if ( args.length != 2 )
7441
{
75-
System.err.println( " - ERROR projectBasedir not exists: " + projectBasedir );
42+
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
7643
System.exit( 1 );
7744
}
7845

79-
log( " - Using base directory: " + projectBasedir );
80-
81-
// If the maven-wrapper.properties exists, read it and check if it contains a custom
82-
// wrapperUrl parameter.
83-
Path mavenWrapperPropertyFile = projectBasedir.resolve( MAVEN_WRAPPER_PROPERTIES_PATH );
84-
String url = readWrapperUrl( mavenWrapperPropertyFile );
85-
8646
try
8747
{
88-
Path outputFile = projectBasedir.resolve( MAVEN_WRAPPER_JAR_PATH );
89-
createDirectories( outputFile.getParent() );
90-
downloadFileFromURL( url, outputFile );
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 );
9153
log( "Done" );
92-
System.exit( 0 );
9354
}
9455
catch ( IOException e )
9556
{
96-
System.err.println( "- Error downloading" );
97-
e.printStackTrace();
57+
System.err.println( "- Error downloading: " + e.getMessage() );
58+
if ( VERBOSE )
59+
{
60+
e.printStackTrace();
61+
}
9862
System.exit( 1 );
9963
}
10064
}
10165

102-
private static void downloadFileFromURL( String urlString, Path destination ) throws IOException
66+
private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
67+
throws IOException
10368
{
104-
log( " - Downloading to: " + destination );
69+
log( " - Downloading to: " + wrapperJarPath );
10570
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
10671
{
10772
final String username = System.getenv( "MVNW_USERNAME" );
@@ -115,40 +80,11 @@ protected PasswordAuthentication getPasswordAuthentication()
11580
}
11681
} );
11782
}
118-
URL website = new URL( urlString );
119-
try ( InputStream inStream = website.openStream() ) {
120-
Files.copy( inStream, destination, StandardCopyOption.REPLACE_EXISTING );
121-
}
122-
log( " - Downloader complete" );
123-
}
124-
125-
private static void createDirectories(Path outputPath) throws IOException
126-
{
127-
if ( !Files.isDirectory( outputPath, LinkOption.NOFOLLOW_LINKS ) ) {
128-
Path createDirectories = Files.createDirectories( outputPath );
129-
log( " - Directories created: " + createDirectories );
130-
}
131-
}
132-
133-
private static String readWrapperUrl( Path mavenWrapperPropertyFile )
134-
{
135-
String url = DEFAULT_DOWNLOAD_URL;
136-
if ( Files.exists( mavenWrapperPropertyFile, LinkOption.NOFOLLOW_LINKS ) )
83+
try ( InputStream inStream = wrapperUrl.openStream() )
13784
{
138-
log( " - Reading property file: " + mavenWrapperPropertyFile );
139-
try ( InputStream in = Files.newInputStream( mavenWrapperPropertyFile, StandardOpenOption.READ ) )
140-
{
141-
Properties mavenWrapperProperties = new Properties();
142-
mavenWrapperProperties.load( in );
143-
url = mavenWrapperProperties.getProperty( PROPERTY_NAME_WRAPPER_URL, DEFAULT_DOWNLOAD_URL );
144-
}
145-
catch ( IOException e )
146-
{
147-
System.err.println( " - ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'" );
148-
}
85+
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
14986
}
150-
log( " - Downloading from: " + url );
151-
return url;
87+
log( " - Downloader complete" );
15288
}
15389

15490
private static void log( String msg )

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
88
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# https://www.apache.org/licenses/LICENSE-2.0
1010
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an

mvnw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# "License"); you may not use this file except in compliance
99
# with the License. You may obtain a copy of the License at
1010
#
11-
# http://www.apache.org/licenses/LICENSE-2.0
11+
# https://www.apache.org/licenses/LICENSE-2.0
1212
#
1313
# Unless required by applicable law or agreed to in writing,
1414
# software distributed under the License is distributed on an

mvnw.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
@REM "License"); you may not use this file except in compliance
88
@REM with the License. You may obtain a copy of the License at
99
@REM
10-
@REM http://www.apache.org/licenses/LICENSE-2.0
10+
@REM https://www.apache.org/licenses/LICENSE-2.0
1111
@REM
1212
@REM Unless required by applicable law or agreed to in writing,
1313
@REM software distributed under the License is distributed on an

0 commit comments

Comments
 (0)