Skip to content

Commit

Permalink
Merge pull request #717 from hazendaz/master
Browse files Browse the repository at this point in the history
Bump maven wrapper to 3.3.2, c3p0 to 0.10.1 with code changes, and update github actions
  • Loading branch information
hazendaz authored May 27, 2024
2 parents a42adf0 + 579086a commit 1e0a367
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 55 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
cache: [maven]
distribution: [temurin]
java: [11, 17, 21, 22, 23-ea]
os: [ubuntu-latest, macos-latest, windows-latest]
java: [11, 17, 21, 22-ea]
distribution: ['temurin']
fail-fast: false
max-parallel: 4
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
Expand All @@ -21,5 +22,6 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: ${{ matrix.cache }}
- name: Test with Maven
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true"
7 changes: 4 additions & 3 deletions .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
cache: maven
distribution: temurin
java-version: 21
distribution: zulu
- name: Report Coverage to Coveralls for Pull Requests
if: github.event_name == 'pull_request'
run: ./mvnw -B -V 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 --no-transfer-progress
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 -B -V 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 --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 6 additions & 9 deletions .github/workflows/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
cache: maven
distribution: temurin
java-version: 21
distribution: zulu
- uses: webfactory/ssh-agent@master
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Build site
run: ./mvnw site site:stage -DskipTests -B -V --no-transfer-progress -Dlicense.skip=true
run: ./mvnw site site:stage -DskipTests -Dlicense.skip=true -B -V --no-transfer-progress --settings ./.mvn/settings.xml
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
- name: Deploy Site to gh-pages
uses: JamesIves/github-pages-deploy-action@v4.6.1
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: true
branch: gh-pages
folder: target/staging
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ssh-key: ${{ secrets.DEPLOY_KEY }}
5 changes: 3 additions & 2 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
cache: maven
distribution: temurin
java-version: 21
distribution: zulu
- name: Analyze with SonarCloud
run: ./mvnw verify jacoco:report sonar:sonar -B -Dsonar.projectKey=mybatis_guice -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN -Dlicense.skip=true --no-transfer-progress
run: ./mvnw verify jacoco:report sonar:sonar -B -V -Dsonar.projectKey=mybatis_guice -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN -Dlicense.skip=true --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/sonatype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
cache: maven
distribution: temurin
java-version: 21
distribution: zulu
- name: Deploy to Sonatype
run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true
env:
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.concurrent.ThreadLocalRandom;

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

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

Expand Down
5 changes: 3 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.1
wrapperVersion=3.3.2
distributionType=source
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
6 changes: 3 additions & 3 deletions mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# ----------------------------------------------------------------------------

# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.1
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Required ENV vars:
# ------------------
Expand Down Expand Up @@ -212,9 +212,9 @@ else
log "Couldn't find $wrapperJarPath, downloading it ..."

if [ -n "$MVNW_REPOURL" ]; then
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar"
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar"
else
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar"
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar"
fi
while IFS="=" read -r key value; do
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
Expand Down
6 changes: 3 additions & 3 deletions mvnw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.1
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
Expand Down Expand Up @@ -119,7 +119,7 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar"
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar"

FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
Expand All @@ -133,7 +133,7 @@ if exist %WRAPPER_JAR% (
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar"
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.10.0-pre3</version>
<version>0.10.1</version>
<optional>true</optional>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2023 the original author or authors.
* Copyright 2009-2024 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 Expand Up @@ -371,18 +371,6 @@ public void setUnreturnedConnectionTimeout(
dataSource.setUnreturnedConnectionTimeout(unreturnedConnectionTimeout);
}

/**
* Sets the uses traditional reflective proxies.
*
* @param usesTraditionalReflectiveProxies
* the new uses traditional reflective proxies
*/
@com.google.inject.Inject(optional = true)
public void setUsesTraditionalReflectiveProxies(
@Named("c3p0.usesTraditionalReflectiveProxies") final boolean usesTraditionalReflectiveProxies) {
dataSource.setUsesTraditionalReflectiveProxies(usesTraditionalReflectiveProxies);
}

@Override
public DataSource get() {
if (username != null) {
Expand Down
7 changes: 1 addition & 6 deletions src/site/xdoc/datasources/c3p0.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2009-2022 the original author or authors.
Copyright 2009-2024 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 Expand Up @@ -195,11 +195,6 @@
<td>false</td>
<td>int</td>
</tr>
<tr>
<td>c3p0.usesTraditionalReflectiveProxies</td>
<td>false</td>
<td>boolean</td>
</tr>
</tbody>
</table>
</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2022 the original author or authors.
* Copyright 2009-2024 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 Expand Up @@ -65,7 +65,6 @@ void get() {
final boolean testConnectionOnCheckin = true;
final boolean testConnectionOnCheckout = true;
final int unreturnedConnectionTimeout = 160;
final boolean usesTraditionalReflectiveProxies = true;
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
Expand Down Expand Up @@ -98,8 +97,6 @@ protected void configure() {
bindConstant().annotatedWith(Names.named("c3p0.testConnectionOnCheckin")).to(testConnectionOnCheckin);
bindConstant().annotatedWith(Names.named("c3p0.testConnectionOnCheckout")).to(testConnectionOnCheckout);
bindConstant().annotatedWith(Names.named("c3p0.unreturnedConnectionTimeout")).to(unreturnedConnectionTimeout);
bindConstant().annotatedWith(Names.named("c3p0.usesTraditionalReflectiveProxies"))
.to(usesTraditionalReflectiveProxies);
}
});
C3p0DataSourceProvider provider = injector.getInstance(C3p0DataSourceProvider.class);
Expand Down Expand Up @@ -134,7 +131,6 @@ protected void configure() {
assertEquals(testConnectionOnCheckin, dataSource.isTestConnectionOnCheckin());
assertEquals(testConnectionOnCheckout, dataSource.isTestConnectionOnCheckout());
assertEquals(unreturnedConnectionTimeout, dataSource.getUnreturnedConnectionTimeout());
assertEquals(usesTraditionalReflectiveProxies, dataSource.isUsesTraditionalReflectiveProxies());
}

@Test
Expand Down Expand Up @@ -167,7 +163,6 @@ void get_OtherValues() {
final boolean testConnectionOnCheckin = false;
final boolean testConnectionOnCheckout = false;
final int unreturnedConnectionTimeout = 161;
final boolean usesTraditionalReflectiveProxies = false;
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
Expand Down Expand Up @@ -200,8 +195,6 @@ protected void configure() {
bindConstant().annotatedWith(Names.named("c3p0.testConnectionOnCheckin")).to(testConnectionOnCheckin);
bindConstant().annotatedWith(Names.named("c3p0.testConnectionOnCheckout")).to(testConnectionOnCheckout);
bindConstant().annotatedWith(Names.named("c3p0.unreturnedConnectionTimeout")).to(unreturnedConnectionTimeout);
bindConstant().annotatedWith(Names.named("c3p0.usesTraditionalReflectiveProxies"))
.to(usesTraditionalReflectiveProxies);
}
});
C3p0DataSourceProvider provider = injector.getInstance(C3p0DataSourceProvider.class);
Expand Down Expand Up @@ -236,7 +229,6 @@ protected void configure() {
assertEquals(testConnectionOnCheckin, dataSource.isTestConnectionOnCheckin());
assertEquals(testConnectionOnCheckout, dataSource.isTestConnectionOnCheckout());
assertEquals(unreturnedConnectionTimeout, dataSource.getUnreturnedConnectionTimeout());
assertEquals(usesTraditionalReflectiveProxies, dataSource.isUsesTraditionalReflectiveProxies());
}

@Test
Expand Down

0 comments on commit 1e0a367

Please sign in to comment.