Skip to content

Commit

Permalink
Merge pull request #876 from hazendaz/master
Browse files Browse the repository at this point in the history
Cleanup argline, use newer charset usage, update maven, fix eol, update github actions
  • Loading branch information
hazendaz authored Aug 27, 2023
2 parents 7ac75d9 + cafcb86 commit 614df5b
Show file tree
Hide file tree
Showing 56 changed files with 238 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=auto
* text=auto
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
- name: Test with Maven
run: ./mvnw test -B -D"license.skip=true"
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true"
4 changes: 2 additions & 2 deletions .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
distribution: zulu
- name: Report Coverage to Coveralls for Pull Requests
if: github.event_name == 'pull_request'
run: ./mvnw test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
- name: Report Coverage to Coveralls for General Push
if: github.event_name == 'push'
run: ./mvnw test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
java-version: 17
distribution: zulu
- name: Analyze with SonarCloud
run: ./mvnw verify jacoco:report sonar:sonar -B -Dsonar.projectKey=mybatis_spring-boot-starter -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dlicense.skip=true
run: ./mvnw verify jacoco:report sonar:sonar -B -Dsonar.projectKey=mybatis_spring-boot-starter -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dlicense.skip=true --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/sonatype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
java-version: 17
distribution: zulu
- name: Deploy to Sonatype
run: ./mvnw deploy -DskipTests -B --settings ./.mvn/settings.xml -Dlicense.skip=true
run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2022 the original author or authors.
Copyright 2015-2023 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5
-Daether.connector.smartChecksums=false
13 changes: 9 additions & 4 deletions .mvn/settings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2022 the original author or authors.
Copyright 2015-2023 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -16,16 +16,21 @@
limitations under the License.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
<!-- Used for gh-pages-scm publish via maven-scm-publish-plugin -->
<server>
<id>gh-pages</id>
<id>gh-pages-scm</id>
<configuration>
<scmVersionType>branch</scmVersionType>
<scmVersion>gh-pages</scmVersion>
</configuration>
</server>
<server>
<id>github</id>
Expand Down
98 changes: 98 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.io.IOException;
import java.io.InputStream;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public final class MavenWrapperDownloader
{
private static final String WRAPPER_VERSION = "3.2.0";

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

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

if ( args.length != 2 )
{
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
System.exit( 1 );
}

try
{
log( " - Downloader started" );
final URL wrapperUrl = new URL( args[0] );
final String jarPath = args[1].replace( "..", "" ); // Sanitize path
final Path wrapperJarPath = Paths.get( jarPath ).toAbsolutePath().normalize();
downloadFileFromURL( wrapperUrl, wrapperJarPath );
log( "Done" );
}
catch ( IOException e )
{
System.err.println( "- Error downloading: " + e.getMessage() );
if ( VERBOSE )
{
e.printStackTrace();
}
System.exit( 1 );
}
}

private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
throws IOException
{
log( " - Downloading to: " + wrapperJarPath );
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
{
final String username = System.getenv( "MVNW_USERNAME" );
final char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
Authenticator.setDefault( new Authenticator()
{
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication( username, password );
}
} );
}
try ( InputStream inStream = wrapperUrl.openStream() )
{
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
}
log( " - Downloader complete" );
}

private static void log( String msg )
{
if ( VERBOSE )
{
System.out.println( msg );
}
}

}
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
Expand Down
2 changes: 1 addition & 1 deletion mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
Expand Down
2 changes: 1 addition & 1 deletion mvnw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public boolean isValid() {

@Override
protected List<String> list(URL url, String path) throws IOException {
String urlString = URLDecoder.decode(url.toString(), urlDecodingCharset.name());
String urlString = URLDecoder.decode(url.toString(), urlDecodingCharset);
String baseUrlString = urlString.endsWith("/") ? urlString : urlString.concat("/");
Resource[] resources = resourceResolver.getResources(baseUrlString + "**/*.class");
return Stream.of(resources).map(resource -> preserveSubpackageName(baseUrlString, resource, path))
Expand Down Expand Up @@ -99,9 +99,10 @@ public static void setClassLoaderSupplier(Supplier<ClassLoader> supplier) {
private static String preserveSubpackageName(final String baseUrlString, final Resource resource,
final String rootPath) {
try {
return rootPath + (rootPath.endsWith("/") ? "" : "/") + Normalizer
.normalize(URLDecoder.decode(resource.getURL().toString(), urlDecodingCharset.name()), Normalizer.Form.NFC)
.substring(baseUrlString.length());
return rootPath + (rootPath.endsWith("/") ? "" : "/")
+ Normalizer
.normalize(URLDecoder.decode(resource.getURL().toString(), urlDecodingCharset), Normalizer.Form.NFC)
.substring(baseUrlString.length());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015-2022 the original author or authors.
# Copyright 2015-2023 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,4 +16,4 @@

# Depends On Database Initialization Detectors
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\
org.mybatis.spring.boot.autoconfigure.MybatisDependsOnDatabaseInitializationDetector
org.mybatis.spring.boot.autoconfigure.MybatisDependsOnDatabaseInitializationDetector
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public class MyBatisConfig {
properties.put("H2", "h2");
databaseIdProvider.setProperties(properties);
return databaseIdProvider;
}
}
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2015-2022 the original author or authors.
* Copyright 2015-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,4 +26,4 @@ li.en {background: url('../images/en.png') left no-repeat;padding-left: 32px; ma
li.es {background: url('../images/es.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ja {background: url('../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px}
li.zh {background: url('../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2015-2022 the original author or authors.
* Copyright 2015-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,4 +26,4 @@ li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px;
li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px}
li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2015-2022 the original author or authors.
* Copyright 2015-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,4 +26,4 @@ li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px;
li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px}
li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2015-2022 the original author or authors.
* Copyright 2015-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,4 +26,4 @@ li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px;
li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px}
li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2015-2022 the original author or authors.
* Copyright 2015-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,4 +26,4 @@ li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px;
li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px}
li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px}
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public class MyBatisConfig {
properties.put("H2", "h2");
databaseIdProvider.setProperties(properties);
return databaseIdProvider;
}
}
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright 2015-2022 the original author or authors.
-- Copyright 2015-2023 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
Expand All @@ -21,4 +21,4 @@
CREATE TABLE customer (
id int AUTO_INCREMENT NOT NULL PRIMARY KEY,
name varchar(50) NOT NULL
);
);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2022 the original author or authors.
Copyright 2015-2023 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -24,4 +24,4 @@
<root level="info">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015-2022 the original author or authors.
# Copyright 2015-2023 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,4 +15,4 @@
#

logging.level.root=WARN
logging.level.sample.mybatis.annotation.mapper=TRACE
logging.level.sample.mybatis.annotation.mapper=TRACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015-2022 the original author or authors.
# Copyright 2015-2023 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,4 +22,4 @@ mybatis.type-aliases-package=sample.mybatis.freemarker.domain

mybatis.scripting-language-driver.freemarker.template-file.base-dir=mappers/
mybatis.scripting-language-driver.freemarker.template-file.path-provider.includes-package-path=false
mybatis.scripting-language-driver.freemarker.template-file.path-provider.separate-directory-per-mapper=false
mybatis.scripting-language-driver.freemarker.template-file.path-provider.separate-directory-per-mapper=false
Loading

0 comments on commit 614df5b

Please sign in to comment.