Skip to content

Commit ac856e3

Browse files
committed
feat
1 parent 0ad21c6 commit ac856e3

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

.github/workflows/maven.yml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# separate terms of service, privacy policy, and support
77
# documentation.
88

9-
name: Java CI with Maven
9+
name: Java CI with mvnd
1010

1111
on:
1212
push:
@@ -26,7 +26,47 @@ jobs:
2626
with:
2727
java-version: '25'
2828
distribution: 'temurin'
29-
cache: 'maven' # 自动缓存 ~/.m2/repository
3029

31-
- name: Build with Maven
32-
run: mvn -B clean package --file pom.xml
30+
# 获取 mvnd 最新 release 版本号
31+
- name: Get mvnd latest release
32+
id: mvnd_release
33+
run: |
34+
LATEST=$(curl -s https://api.github.com/repos/apache/maven-mvnd/releases/latest | jq -r .tag_name)
35+
echo "version=$LATEST" >> $GITHUB_OUTPUT
36+
37+
# 缓存 mvnd 仅限解压后的版本目录(避免日志和临时文件)
38+
- name: Cache mvnd binaries
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/.mvnd/maven-mvnd-${{ steps.mvnd_release.outputs.version }}-linux-amd64
42+
key: mvnd-${{ runner.os }}-${{ steps.mvnd_release.outputs.version }}
43+
44+
# 安装 mvnd(如果缓存里没有)
45+
- name: Install mvnd
46+
run: |
47+
VERSION=${{ steps.mvnd_release.outputs.version }}
48+
if [ ! -d "$HOME/.mvnd/maven-mvnd-${VERSION}-linux-amd64" ]; then
49+
curl -L "https://github.com/apache/maven-mvnd/releases/download/${VERSION}/maven-mvnd-${VERSION}-linux-amd64.zip" -o mvnd.zip
50+
unzip -o mvnd.zip -d ~/.mvnd
51+
fi
52+
53+
# 把 mvnd 加到 PATH(避免重复写入)
54+
- name: Add mvnd to PATH
55+
run: |
56+
VERSION=${{ steps.mvnd_release.outputs.version }}
57+
BIN="$HOME/.mvnd/maven-mvnd-${VERSION}-linux-amd64/bin"
58+
if ! grep -qxF "$BIN" "$GITHUB_PATH"; then
59+
echo "$BIN" >> $GITHUB_PATH
60+
fi
61+
62+
# 缓存 Maven 仓库
63+
- name: Cache Maven repository
64+
uses: actions/cache@v4
65+
with:
66+
path: ~/.m2/repository
67+
key: maven-${{ hashFiles('**/pom.xml') }}
68+
restore-keys: |
69+
maven-
70+
71+
- name: Build with mvnd
72+
run: mvnd -B clean package --file pom.xml

spring-testcontainers-support/src/main/java/com/livk/testcontainers/DockerImageNames.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ public static DockerImageName redisStack(String tag) {
8787
return DockerImageName.parse(REDIS_STACK_IMAGE).withTag(tag);
8888
}
8989

90+
/**
91+
* <a href="https://github.com/ClickHouse/clickhouse-java/issues/2636">github
92+
* issue</a>
93+
*/
9094
public static DockerImageName clickhouse() {
91-
return clickhouse(LATEST_TAG);
95+
return clickhouse("25.9");
9296
}
9397

9498
public static DockerImageName clickhouse(String tag) {

0 commit comments

Comments
 (0)