Monday, December 1, 2014

Maven: Include text or xml file as resources in a Maven project

Frequently we may have some text files or xml or other files which must be included in a Maven project. The way to do it is quite simple. Firstly create a subfolder under the project root folder, e.g., "src/main/resources". Next include the folder location in the build section of the pom file:

<build>
...
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
...
</build>

Next run the following command in the project's root folder:

> mvn resources:resources

No comments:

Post a Comment