Skip to content

Commit f712293

Browse files
committed
发布 1.1.1 版本,升级依赖版本,替换 log4j 为 logback
1 parent 9490efc commit f712293

File tree

6 files changed

+83
-34
lines changed

6 files changed

+83
-34
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
push:
4+
tags: [ "*" ]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Set up Maven Central Repository
11+
uses: actions/setup-java@v2
12+
with:
13+
java-version: '8'
14+
distribution: 'adopt'
15+
server-id: ossrh
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
- id: install-secret-key
19+
name: Install gpg secret key
20+
run: |
21+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
22+
gpg --list-secret-keys --keyid-format LONG
23+
- name: Publish package
24+
env:
25+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
26+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
27+
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -P release clean deploy

.github/workflows/verify.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Maven verify
2+
on:
3+
pull_request:
4+
types: [ opened, reopened, edited ]
5+
push:
6+
branches: [ develop, master ]
7+
jobs:
8+
mvn_verify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Maven Central Repository
13+
uses: actions/setup-java@v2
14+
with:
15+
java-version: '8'
16+
distribution: 'adopt'
17+
- name: Run the Maven verify phase
18+
run: mvn --batch-mode --update-snapshots verify

pom.xml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<groupId>io.mybatis</groupId>
2424
<artifactId>mybatis-provider</artifactId>
25-
<version>1.1.0</version>
25+
<version>1.1.1</version>
2626

2727
<name>MyBatis Provider</name>
2828
<description>MyBatis Provider 扩展</description>
@@ -57,10 +57,10 @@
5757
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5858
<argLine>-Dfile.encoding=UTF-8</argLine>
5959

60+
<logback.version>1.2.11</logback.version>
6061
<mybatis.version>3.5.9</mybatis.version>
6162
<lombok.version>1.18.22</lombok.version>
62-
<hsqldb.version>2.5.1</hsqldb.version>
63-
<log4j.version>1.2.17</log4j.version>
63+
<hsqldb.version>2.5.2</hsqldb.version>
6464
<junit.version>4.13</junit.version>
6565
</properties>
6666

@@ -79,8 +79,8 @@
7979
<artifactId>hsqldb</artifactId>
8080
</dependency>
8181
<dependency>
82-
<groupId>log4j</groupId>
83-
<artifactId>log4j</artifactId>
82+
<groupId>ch.qos.logback</groupId>
83+
<artifactId>logback-classic</artifactId>
8484
</dependency>
8585
<dependency>
8686
<groupId>junit</groupId>
@@ -111,9 +111,9 @@
111111
<scope>test</scope>
112112
</dependency>
113113
<dependency>
114-
<groupId>log4j</groupId>
115-
<artifactId>log4j</artifactId>
116-
<version>${log4j.version}</version>
114+
<groupId>ch.qos.logback</groupId>
115+
<artifactId>logback-classic</artifactId>
116+
<version>${logback.version}</version>
117117
<scope>test</scope>
118118
</dependency>
119119
<dependency>
@@ -157,7 +157,7 @@
157157
</pluginRepositories>
158158
</profile>
159159
<profile>
160-
<id>deploy-oss-maven</id>
160+
<id>release</id>
161161
<build>
162162
<plugins>
163163
<!-- Source -->
@@ -206,16 +206,32 @@
206206
</goals>
207207
</execution>
208208
</executions>
209+
<configuration>
210+
<gpgArguments>
211+
<argument>--pinentry-mode</argument>
212+
<argument>loopback</argument>
213+
</gpgArguments>
214+
</configuration>
215+
</plugin>
216+
<plugin>
217+
<groupId>org.sonatype.plugins</groupId>
218+
<artifactId>nexus-staging-maven-plugin</artifactId>
219+
<extensions>true</extensions>
220+
<configuration>
221+
<serverId>ossrh</serverId>
222+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
223+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
224+
</configuration>
209225
</plugin>
210226
</plugins>
211227
</build>
212228
<distributionManagement>
213229
<snapshotRepository>
214-
<id>oss</id>
230+
<id>ossrh</id>
215231
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
216232
</snapshotRepository>
217233
<repository>
218-
<id>oss</id>
234+
<id>ossrh</id>
219235
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
220236
</repository>
221237
</distributionManagement>

src/test/resources/log4j.properties

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/test/resources/logback.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<configuration>
2+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
3+
<encoder>
4+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
5+
</encoder>
6+
</appender>
7+
<root level="debug">
8+
<appender-ref ref="STDOUT"/>
9+
</root>
10+
</configuration>

src/test/resources/mybatis-config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"http://mybatis.org/dtd/mybatis-3-config.dtd">
2121
<configuration>
2222
<settings>
23-
<setting name="logImpl" value="LOG4J"/>
23+
<setting name="logImpl" value="SLF4J"/>
2424
<setting name="cacheEnabled" value="true"/>
2525
<setting name="mapUnderscoreToCamelCase" value="true"/>
2626
<setting name="aggressiveLazyLoading" value="false"/>

0 commit comments

Comments
 (0)