diff --git a/.gitattributes b/.gitattributes index 212566614..176a458f9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -* text=auto \ No newline at end of file +* text=auto diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ab86305b8..35d90bebe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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" diff --git a/.github/workflows/coveralls.yaml b/.github/workflows/coveralls.yaml index 9ad6d187d..216d2246e 100644 --- a/.github/workflows/coveralls.yaml +++ b/.github/workflows/coveralls.yaml @@ -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 }} diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index b0dab7eb7..59e6986f3 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -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 }} diff --git a/.github/workflows/sonatype.yaml b/.github/workflows/sonatype.yaml index fa4a4a7fd..b605b5f0e 100644 --- a/.github/workflows/sonatype.yaml +++ b/.github/workflows/sonatype.yaml @@ -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 }} diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 2b1cf2cf8..e1c7272d9 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -1,7 +1,7 @@ - + ossrh ${env.CI_DEPLOY_USERNAME} ${env.CI_DEPLOY_PASSWORD} + - gh-pages + gh-pages-scm + + branch + gh-pages + github diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 000000000..f57fd86fb --- /dev/null +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -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 ); + } + } + +} diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index ac184013f..3267ebce8 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -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 diff --git a/mvnw b/mvnw index 8d937f4c1..66df28542 100755 --- a/mvnw +++ b/mvnw @@ -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 diff --git a/mvnw.cmd b/mvnw.cmd index c4586b564..95ba6f54a 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -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 diff --git a/mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/SpringBootVFS.java b/mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/SpringBootVFS.java index 7bd3dfc32..51ba40a04 100644 --- a/mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/SpringBootVFS.java +++ b/mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/SpringBootVFS.java @@ -59,7 +59,7 @@ public boolean isValid() { @Override protected List 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)) @@ -99,9 +99,10 @@ public static void setClassLoaderSupplier(Supplier 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); } diff --git a/mybatis-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/mybatis-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories index 6b67dd182..03d145ae2 100644 --- a/mybatis-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/mybatis-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories @@ -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. @@ -16,4 +16,4 @@ # Depends On Database Initialization Detectors org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\ -org.mybatis.spring.boot.autoconfigure.MybatisDependsOnDatabaseInitializationDetector \ No newline at end of file +org.mybatis.spring.boot.autoconfigure.MybatisDependsOnDatabaseInitializationDetector diff --git a/mybatis-spring-boot-autoconfigure/src/site/markdown/index.md b/mybatis-spring-boot-autoconfigure/src/site/markdown/index.md index 2e8dc94eb..47e0dff35 100644 --- a/mybatis-spring-boot-autoconfigure/src/site/markdown/index.md +++ b/mybatis-spring-boot-autoconfigure/src/site/markdown/index.md @@ -294,7 +294,7 @@ public class MyBatisConfig { properties.put("H2", "h2"); databaseIdProvider.setProperties(properties); return databaseIdProvider; - } + } } ``` diff --git a/mybatis-spring-boot-autoconfigure/src/site/resources/css/site.css b/mybatis-spring-boot-autoconfigure/src/site/resources/css/site.css index 298b451df..14a9eebcc 100644 --- a/mybatis-spring-boot-autoconfigure/src/site/resources/css/site.css +++ b/mybatis-spring-boot-autoconfigure/src/site/resources/css/site.css @@ -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. @@ -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} \ No newline at end of file +li.ko {background: url('../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} diff --git a/mybatis-spring-boot-autoconfigure/src/site/resources/es/css/site.css b/mybatis-spring-boot-autoconfigure/src/site/resources/es/css/site.css index 82e53f64c..804cd2bb0 100644 --- a/mybatis-spring-boot-autoconfigure/src/site/resources/es/css/site.css +++ b/mybatis-spring-boot-autoconfigure/src/site/resources/es/css/site.css @@ -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. @@ -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} \ No newline at end of file +li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} diff --git a/mybatis-spring-boot-autoconfigure/src/site/resources/ja/css/site.css b/mybatis-spring-boot-autoconfigure/src/site/resources/ja/css/site.css index 82e53f64c..804cd2bb0 100644 --- a/mybatis-spring-boot-autoconfigure/src/site/resources/ja/css/site.css +++ b/mybatis-spring-boot-autoconfigure/src/site/resources/ja/css/site.css @@ -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. @@ -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} \ No newline at end of file +li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} diff --git a/mybatis-spring-boot-autoconfigure/src/site/resources/ko/css/site.css b/mybatis-spring-boot-autoconfigure/src/site/resources/ko/css/site.css index 82e53f64c..804cd2bb0 100644 --- a/mybatis-spring-boot-autoconfigure/src/site/resources/ko/css/site.css +++ b/mybatis-spring-boot-autoconfigure/src/site/resources/ko/css/site.css @@ -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. @@ -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} \ No newline at end of file +li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} diff --git a/mybatis-spring-boot-autoconfigure/src/site/resources/zh/css/site.css b/mybatis-spring-boot-autoconfigure/src/site/resources/zh/css/site.css index 82e53f64c..804cd2bb0 100644 --- a/mybatis-spring-boot-autoconfigure/src/site/resources/zh/css/site.css +++ b/mybatis-spring-boot-autoconfigure/src/site/resources/zh/css/site.css @@ -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. @@ -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} \ No newline at end of file +li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} diff --git a/mybatis-spring-boot-autoconfigure/src/site/zh/markdown/index.md b/mybatis-spring-boot-autoconfigure/src/site/zh/markdown/index.md index 3928f5581..77b4f7673 100644 --- a/mybatis-spring-boot-autoconfigure/src/site/zh/markdown/index.md +++ b/mybatis-spring-boot-autoconfigure/src/site/zh/markdown/index.md @@ -293,7 +293,7 @@ public class MyBatisConfig { properties.put("H2", "h2"); databaseIdProvider.setProperties(properties); return databaseIdProvider; - } + } } ``` diff --git a/mybatis-spring-boot-autoconfigure/src/test/resources/db/changelog/db.changelog-override.sql b/mybatis-spring-boot-autoconfigure/src/test/resources/db/changelog/db.changelog-override.sql index 2afac912d..e508eb73d 100644 --- a/mybatis-spring-boot-autoconfigure/src/test/resources/db/changelog/db.changelog-override.sql +++ b/mybatis-spring-boot-autoconfigure/src/test/resources/db/changelog/db.changelog-override.sql @@ -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. @@ -21,4 +21,4 @@ CREATE TABLE customer ( id int AUTO_INCREMENT NOT NULL PRIMARY KEY, name varchar(50) NOT NULL -); \ No newline at end of file +); diff --git a/mybatis-spring-boot-autoconfigure/src/test/resources/logback-test.xml b/mybatis-spring-boot-autoconfigure/src/test/resources/logback-test.xml index e9eed2e08..048eddc66 100644 --- a/mybatis-spring-boot-autoconfigure/src/test/resources/logback-test.xml +++ b/mybatis-spring-boot-autoconfigure/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ 1684572441