0
我有一个春天项目与下面有一个片段的POM文件 -参考春到资源文件的application.properties
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetPath>WEB-INF</targetPath>
<includes>
<include>**/*.csv</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
我的源码目录的src/main/webapp的有一个名为MYFILE csv文件。 CSV。
在执行mvn clean install时,此csv文件存储在我的目标/ myproject-0.2.0-SNAPSHOT目录中。
我需要在application.properties文件中使用什么字符串才能到达此文件的位置?此应用程序作为战争文件部署时,这个值是否也适用。另外,理想情况下,资源应该放在WEB-INF目录下,如果是的话,我需要在我的POM文件中进行更改。
非常感谢。所以在application.properties文件中,我可以简单地使用这个 - myfile.path = /someTextFile.csv? – lenniekid