maven打包 springBoot 工程时,默认识别resources目录,习惯使用 resource 目录的须要手动指定静态资源目录

最近项目开发,发现springBoot项目在使用maven打包时,咱们静态资源文件都放在resource目录下面,大体以下:spring

在使用maven打包时,发现静态资源没有打进去。原来springBoot默认静态资源路径的时resources.maven

那解决静态资源文件使用maven打包问题的解决方案就有两种了:spring-boot

    1.将静态资源文件夹名从resource改成resourcesui

 

    2.在工程pom.xml中加入resource目录配置,手动去指定。咱们习惯使用resource目录,因此使用了手动指定xml

<build>
<finalName>shengshi-property-management</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resource</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</build>blog

相关文章
相关标签/搜索