Copy any properties files to classes folder using maven
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
posted
0
Hi,
I have few properties files in my source folders..
src-main-java-com.xyz.business.forms
now when i install the war its able to get all java classes into the target but not the properties files. What should be done to get these properties files also..
In a typical maven project directory structure, resource files, such as properties file, should be placed in src/main/resources. For example, if you have a properties file named com.xyz.business.forms.properties, it should be located at:
i agree that typically we are supposed to use resources folder.. but these properties files are used by these classes and they have be present in those folders only..
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
posted
0
But cant we have them in the same folder structure as in java..
rather than in having them in... resources/com/xyz/business/..
but these properties files are used by these classes and they have be present in those folders only
The resources will be copied into the same target/classes directory as your compiled classes, and thus classes and resources will reside in the same folder. It is only during editing time that the java source file and resources appear in different locations.