Bläddra i källkod

refactor: setting.xml更新

fanyanpeng 1 år sedan
förälder
incheckning
ff3da29be9
2 ändrade filer med 6 tillägg och 10 borttagningar
  1. 6 4
      Dockerfile
  2. 0 6
      settings.xml

+ 6 - 4
Dockerfile

@@ -5,11 +5,13 @@ FROM maven:3.8.5-openjdk-17-slim AS build
 # Set the working directory in the container
 WORKDIR /app
 # Copy the pom.xml and the project files to the container
-COPY pom.xml .
-COPY src ./src
-COPY settings.xml /usr/share/maven/ref/
+ADD ./pom.xml pom.xml
+ADD settings.xml /usr/share/maven/ref/
+RUN  mvn install -Dmaven.repo.local=./.m2
+
+ADD ./src src/
 # Build the application using Maven
-RUN mvn clean package -DskipTests
+RUN mvn clean package -DskipTests  -Dmaven.repo.local=./.m2
 
 # Use an official OpenJDK image as the base image
 FROM openjdk:17-jdk-slim

+ 0 - 6
settings.xml

@@ -15,12 +15,6 @@
             <name>阿里云公共仓库</name>
             <url>https://maven.aliyun.com/repository/central</url>
         </mirror>
-        <mirror>
-            <id>repo1</id>
-            <mirrorOf>central</mirrorOf>
-            <name>central repo</name>
-            <url>http://repo1.maven.org/maven2/</url>
-        </mirror>
         <mirror>
             <id>aliyunmaven</id>
             <mirrorOf>apache snapshots</mirrorOf>