我在Spring Boot对象中使用以下构建设置:
<build>
<resources>
<resource>
<directory>src/main/resources/clientApp</directory>
<excludes>
<exclude>node_modules/**</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
包含node.js应用程序的整个clientApp目录已正确复制,没有不需要的node_modules目录。作为不必要的副作用,不再复制application.properties/.yml文件。
我如何才能获取node_modules目录,而且application.yml会被复制?
答案 0 :(得分:1)
您可以为include
application.properties|yaml
<build>
<resources>
<resource>
<directory>src/main/resources/clientApp</directory>
<includes>
<include>node_modules/application.*</include>
</includes>
<excludes>
<exclude>node_modules/**</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
或者,您可以考虑将application.properties|yaml
从src/main/resources/clientApp/node_modules
移至src/main/resources/clientApp
。