spring boot不使用resoures而是建立一个conf
一般配置文件都是放在rsources下,有时候我们不想放在这里,而是直接放在根目录下,那么我们应该怎么做呢?
1.在pom.xml中添加:
<build> <!--<finalName>${project.artifactId}</finalName>--> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins>
<!--conf的配置--> <resources> <resource> <directory>conf</directory> </resource> <resource> <directory>src/main/java</directory> <includes> <include>../../conf/*.properties</include> <include>../../conf/*.xml</include> </includes> </resource> </resources> </build>
2.在项目目录下建立conf目录:
即可!
程序员的眼里,不止有代码和bug,还有诗与远方和妹子!!!