Commit 2f84ecb2 by zhangxingmin

push

parent 06ee77f6
......@@ -4,8 +4,8 @@ FROM openjdk:8
LABEL maintainer="zxm<2060197959@qq.com>"
# 创建目录
RUN mkdir -p /home/app
# 拷贝项目jar
COPY target/yd-user-api-1.0-SNAPSHOT.jar /home/app/yd-user-api.jar
# 拷贝项目jar - 使用可执行的 fat JAR
COPY target/yd-user-api-1.0-SNAPSHOT-exec.jar /home/app/yd-user-api.jar
# 执行命令启动jar
ENTRYPOINT ["java", "-jar", "/home/app/yd-user-api.jar"]
# 暴露端口
......
......@@ -78,32 +78,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<configuration>
<!-- 禁用重新打包,保持标准 JAR 结构 -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<goals>
<!-- 只生成启动脚本,不重新打包 -->
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 添加 Main-Class 到清单 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<classifier>exec</classifier>
<mainClass>com.yd.user.api.UserApiApplication</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment