Modifying the port and configuration after spring boot is packaged and released does not work

The development environment is good. After
publishing to the server, the port is changed and it is not normal. The port number configured in the development environment is still used...

The configuration in pom.xml is as follows.

 <resources>
     <resource>
         <directory>src/main/java</directory>
         <includes>
             <include>**/*.*</include>
         </includes>
     </resource>
     <resource>
         <directory>src/main/resources</directory>
         <includes>
             <include>**/*.*</include>
         </includes>
     </resource>
 </resources>

All as follows

<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>

Later, I really couldn’t find the reason.
I started to guess the mode. I released the packaged application.properties and placed it in the classes directory.
Is it misplaced? So I took a try. Moved up one level. . It turned out to be amazing...

Insert picture description here

Guess you like

Origin blog.csdn.net/phker/article/details/111993471