在POM.XML的<build></build>中配置如下:

        <resources>
            <resource>
                <directory>src\main\resources</directory>
                <excludes>
                    <exclude>application.properties</exclude>
                    <exclude>log4j2.xml</exclude>
                </excludes>
            </resource>
        </resources>

这句话就可以不把配置文件打包到JAR中。

启动方式,指定logging的配置即可。

java -jar hxgw-1.0-SNAPSHOT.jar --logging.config=./log4j2.xml

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2021-10-17
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案