Skip to content

Commit a59f7dd

Browse files
committed
Merge branch 'master' into pr/6
2 parents cc58a3a + ed132e3 commit a59f7dd

23 files changed

+1360
-27
lines changed

Diff for: .github/workflows/ci.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Java CI
2+
3+
on: [workflow_dispatch, push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
cache: [maven]
11+
distribution: [temurin]
12+
java: [17, 21, 22, 23-ea]
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
fail-fast: false
15+
max-parallel: 4
16+
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: ${{ matrix.java }}
24+
distribution: ${{ matrix.distribution }}
25+
cache: ${{ matrix.cache }}
26+
- name: Test with Maven
27+
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true"

Diff for: .github/workflows/codeql.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
branches: [ "master" ]
19+
schedule:
20+
- cron: '28 4 * * 1'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners
29+
# Consider using larger runners for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
32+
permissions:
33+
# required for all workflows
34+
security-events: write
35+
36+
# only required for workflows in private repositories
37+
actions: read
38+
contents: read
39+
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
language: [ ]
44+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
45+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
46+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
47+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
48+
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
53+
- name: Setup Java
54+
uses: actions/setup-java@v4
55+
with:
56+
java-version: 17
57+
distribution: 'temurin'
58+
59+
# Initializes the CodeQL tools for scanning.
60+
- name: Initialize CodeQL
61+
uses: github/codeql-action/init@v3
62+
with:
63+
languages: ${{ matrix.language }}
64+
# If you wish to specify custom queries, you can do so here or in a config file.
65+
# By default, queries listed here will override any specified in a config file.
66+
# Prefix the list here with "+" to use these queries and those in the config file.
67+
68+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
69+
# queries: security-extended,security-and-quality
70+
71+
72+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
73+
# If this step fails, then you should remove it and run the build manually (see below)
74+
- name: Autobuild
75+
uses: github/codeql-action/autobuild@v3
76+
77+
# ℹ️ Command-line programs to run using the OS shell.
78+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
80+
# If the Autobuild fails above, remove it and uncomment the following three lines.
81+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
82+
83+
# - run: |
84+
# echo "Run, Build Application using script"
85+
# ./location_of_script_within_repo/buildscript.sh
86+
87+
- name: Perform CodeQL Analysis
88+
uses: github/codeql-action/analyze@v3
89+
with:
90+
category: "/language:${{matrix.language}}"

Diff for: .github/workflows/site.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Site
2+
3+
on:
4+
push:
5+
branches:
6+
- site
7+
8+
jobs:
9+
build:
10+
if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]')
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK
15+
uses: actions/setup-java@v4
16+
with:
17+
cache: maven
18+
distribution: temurin
19+
java-version: 21
20+
- name: Build site
21+
run: ./mvnw site site:stage -DskipTests -Dlicense.skip=true -B -V --no-transfer-progress --settings ./.mvn/settings.xml
22+
env:
23+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
26+
- name: Deploy Site to gh-pages
27+
uses: JamesIves/github-pages-deploy-action@v4
28+
with:
29+
branch: gh-pages
30+
folder: target/staging
31+
ssh-key: ${{ secrets.DEPLOY_KEY }}

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/.project
2+
target/
3+
.github/keys/

Diff for: .mvn/extensions.xml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2004-2024 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<extensions>
20+
<extension>
21+
<groupId>fr.jcgay.maven</groupId>
22+
<artifactId>maven-profiler</artifactId>
23+
<version>3.2</version>
24+
</extension>
25+
</extensions>

Diff for: .mvn/maven.config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5
2+
-Daether.connector.smartChecksums=false

Diff for: .mvn/settings.xml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2004-2024 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
21+
22+
<servers>
23+
<!-- Used for sonatype snapshots and releases -->
24+
<server>
25+
<id>ossrh</id>
26+
<username>${env.CI_DEPLOY_USERNAME}</username>
27+
<password>${env.CI_DEPLOY_PASSWORD}</password>
28+
</server>
29+
30+
<!-- Used for gh-pages-scm publish via maven-scm-publish-plugin -->
31+
<server>
32+
<id>gh-pages-scm</id>
33+
<configuration>
34+
<scmVersionType>branch</scmVersionType>
35+
<scmVersion>gh-pages</scmVersion>
36+
</configuration>
37+
</server>
38+
39+
<!-- Github deployments (site) -->
40+
<server>
41+
<id>github</id>
42+
<username>${env.CI_DEPLOY_USERNAME}</username>
43+
<password>${env.GITHUB_TOKEN}</password>
44+
</server>
45+
46+
<!-- NVD API Access (dependency-check-plugin) -->
47+
<server>
48+
<id>nvd</id>
49+
<password>${env.NVD_API_KEY}</password>
50+
</server>
51+
</servers>
52+
53+
</settings>

Diff for: .mvn/wrapper/MavenWrapperDownloader.java

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
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
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
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.
18+
*/
19+
20+
import java.io.IOException;
21+
import java.io.InputStream;
22+
import java.net.Authenticator;
23+
import java.net.PasswordAuthentication;
24+
import java.net.URI;
25+
import java.net.URL;
26+
import java.nio.file.Files;
27+
import java.nio.file.Path;
28+
import java.nio.file.Paths;
29+
import java.nio.file.StandardCopyOption;
30+
import java.util.concurrent.ThreadLocalRandom;
31+
32+
public final class MavenWrapperDownloader {
33+
private static final String WRAPPER_VERSION = "3.3.2";
34+
35+
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE"));
36+
37+
public static void main(String[] args) {
38+
log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION);
39+
40+
if (args.length != 2) {
41+
System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing");
42+
System.exit(1);
43+
}
44+
45+
try {
46+
log(" - Downloader started");
47+
final URL wrapperUrl = URI.create(args[0]).toURL();
48+
final String jarPath = args[1].replace("..", ""); // Sanitize path
49+
final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize();
50+
downloadFileFromURL(wrapperUrl, wrapperJarPath);
51+
log("Done");
52+
} catch (IOException e) {
53+
System.err.println("- Error downloading: " + e.getMessage());
54+
if (VERBOSE) {
55+
e.printStackTrace();
56+
}
57+
System.exit(1);
58+
}
59+
}
60+
61+
private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath)
62+
throws IOException {
63+
log(" - Downloading to: " + wrapperJarPath);
64+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
65+
final String username = System.getenv("MVNW_USERNAME");
66+
final char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
67+
Authenticator.setDefault(new Authenticator() {
68+
@Override
69+
protected PasswordAuthentication getPasswordAuthentication() {
70+
return new PasswordAuthentication(username, password);
71+
}
72+
});
73+
}
74+
Path temp = wrapperJarPath
75+
.getParent()
76+
.resolve(wrapperJarPath.getFileName() + "."
77+
+ Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp");
78+
try (InputStream inStream = wrapperUrl.openStream()) {
79+
Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING);
80+
Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING);
81+
} finally {
82+
Files.deleteIfExists(temp);
83+
}
84+
log(" - Downloader complete");
85+
}
86+
87+
private static void log(String msg) {
88+
if (VERBOSE) {
89+
System.out.println(msg);
90+
}
91+
}
92+
93+
}

Diff for: .mvn/wrapper/maven-wrapper.properties

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
# https://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+
wrapperVersion=3.3.2
18+
distributionType=source
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

0 commit comments

Comments
 (0)