spring boot打包发布后修改端口和配置不起作用
程序员文章站
2022-03-19 15:59:08
在开发环境好好的.发布到服务器后改了下端口怎么改都不正常. 还是用的开发环境配置的端口号…pom.xml中的配置如下. src/main/java **/*.*
在开发环境好好的.
发布到服务器后改了下端口怎么改都不正常. 还是用的开发环境配置的端口号…
pom.xml中的配置如下.
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
全部如下
<build>
<finalName>bsn-java</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<fork>true</fork>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
</plugin> -->
<!-- Maven插件 配置 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<fork>true</fork>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
<source>1.8</source>
<target>1.8</target>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArguments>
<verbose/><!-- 这个选项用来传递编译器自身不包含但是却支持的参数选项 -->
<bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath><!-- windows编译时使用分号;,linux编译时使用冒号: -->
</compilerArguments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<!-- 增加配置 -->
<configuration>
<!-- assembly.xml文件路径 -->
<descriptors>
<descriptor>src/main/resources/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
后来实在是找不到原因了. 开始瞎猜模式.
我发布打包后的 application.properties 是放在classes目录下的.
是不是放错地方了? 于是抱着试试看的态度. 向上移动了一层. 结果就神奇的好了…
本文地址:https://blog.csdn.net/phker/article/details/111993471
上一篇: ssm 对接vue跨域问题
下一篇: 函数式接口Stream类