chore: configure Maven to use Aliyun mirror
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
FROM maven:3.9-eclipse-temurin-17 AS build
|
||||
WORKDIR /app
|
||||
|
||||
# 配置 Maven 使用阿里云镜像源
|
||||
COPY settings.xml /usr/share/maven/conf/settings.xml
|
||||
|
||||
# 复制项目源码
|
||||
COPY . .
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
FROM maven:3.9-eclipse-temurin-17 AS build
|
||||
WORKDIR /app
|
||||
|
||||
# 配置 Maven 使用阿里云镜像源
|
||||
COPY settings.xml /usr/share/maven/conf/settings.xml
|
||||
|
||||
# 复制项目源码
|
||||
COPY . .
|
||||
|
||||
|
||||
21
settings.xml
Normal file
21
settings.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0
|
||||
http://maven.apache.org/xsd/settings-1.2.0.xsd">
|
||||
|
||||
<!-- 配置阿里云镜像,加速依赖下载 -->
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>aliyunmaven</id>
|
||||
<mirrorOf>central</mirrorOf>
|
||||
<name>阿里云公共仓库</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
|
||||
<!-- 可选:配置本地仓库路径 -->
|
||||
<localRepository>/root/.m2/repository</localRepository>
|
||||
|
||||
</settings>
|
||||
|
||||
Reference in New Issue
Block a user