build(docker):优化Maven构建缓存并添加仓库配置
Some checks failed
Auto-build / Automatic-Packaging (push) Failing after 5m12s
Some checks failed
Auto-build / Automatic-Packaging (push) Failing after 5m12s
- 修改Dockerfile中Maven命令以使用本地缓存目录 - 在pom.xml中显式添加Maven中央仓库配置 - 为Ehcache依赖项添加具体版本号3.11.0 - 调整Maven构建参数顺序以提高构建效率
This commit is contained in:
parent
d8140d12db
commit
9146dfbb54
@ -1,9 +1,9 @@
|
||||
FROM maven:3.8.4-openjdk-17 AS builder
|
||||
WORKDIR /app
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:go-offline
|
||||
RUN mvn install -Dmaven.repo.local=./.m2
|
||||
COPY src ./src
|
||||
RUN mvn clean package -DskipTests=true -P prod
|
||||
RUN mvn clean package -Dmaven.repo.local=./.m2 -DskipTests=true -P prod
|
||||
|
||||
|
||||
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
||||
|
||||
7
pom.xml
7
pom.xml
@ -26,6 +26,12 @@
|
||||
<tag/>
|
||||
<url/>
|
||||
</scm>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>maven-central</id>
|
||||
<url>https://repo.maven.apache.org/maven2</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
@ -98,6 +104,7 @@
|
||||
<dependency>
|
||||
<groupId>org.ehcache</groupId>
|
||||
<artifactId>ehcache</artifactId>
|
||||
<version>3.11.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user