Commit af40bbed authored by junshizhonglangjiang's avatar junshizhonglangjiang

打包方式调整

parent 844dc1cc
......@@ -62,114 +62,46 @@
</dependency>
</dependencies>
<build>
<finalName>projectname-${project.version}</finalName>
<!-- 最终JAR包名称:模块名-版本号.jar -->
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<!-- 编译插件(继承父工程配置,保持版本一致) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<excludes>
<!--<exclude>*</exclude>-->
<!--<exclude>*.sh</exclude>-->
<!--<exclude>*.bat</exclude>-->
</excludes>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- Spring Boot打包核心插件(生成可运行JAR) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/projectname-${project.version}/lib
</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.13.RELEASE</version> <!-- 与父工程Spring Boot版本完全一致 -->
<configuration>
<!-- 必须指定启动类(替换为你的实际主类全路径) -->
<mainClass>com.zehong.ZhMesAgecalApplication</mainClass>
<!-- 排除开发环境依赖(如devtools) -->
<excludes>
<exclude>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>copy-config</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${project.build.directory}/projectname-${project.version}/conf</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.yml</include>
<include>**/logback.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-sh</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
<goal>repackage</goal> <!-- 重新打包为可执行JAR -->
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${project.build.directory}/projectname-${project.version}/bin</outputDirectory>
<resources>
<resource>
<directory>src/main/bin</directory>
<includes>
<include>*.sh</include>
<include>*.bat</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-dist-jar</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${project.build.directory}/projectname-${project.version}/lib</outputDirectory>
<resources>
<resource>
<directory>target</directory>
<includes>
<include>*.jar</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 8080
port: 8087
servlet:
# 应用的访问路径
context-path: /
context-path: /agecal
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
......
......@@ -34,7 +34,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
target: `http://localhost:8080/agecal`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......
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