配置文件放在jar外部
启动命令使用如下:
nohup java -Xms512M -Xmx4096M -jar -Dfile.encoding=utf-8 -Dspring.config.location=./config/application.properties taiping-0.0.1-SNAPSHOT.jar > ./log/output 2>&1 & echo "service starting"
在工程的pom.xml中,在build节点加上下列配置
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludes>
<exclude>application.yml</exclude>
</excludes>
</configuration>
</plugin>
...
</plugins>
</build>
网友评论