Maven how to enable / src / main / resources

I have a mavenized project with jar packaging, have a standard layout:

/src/main/java /src/main/resources 

When I execute: mvn package

I expect the resulting jar (non-executing) file will contain a resource folder and everything inside this folder from the project (i.e. some xml files), but when I open the jar file I only see the com folder, where is the contents of the resource folder at the top level ...

I think the above default is for maven3, but I want to include the resources folder in the jar file ...

+6
source share
1 answer

You will not see src/main/resources in the given jar file.

You will see the contents of src/main/resources in the jar file.

So, if you did not create a package structure for your resource files and did not upload everything to the src/main/resources directory, you will see your resource files at the top level of your bank.

If you want your resources to appear in a specific directory in the resulting jar file, create such a directory under the src/main/resources tree.

+12
source

All Articles