I have the following problem creating a .jar file using Ant.
I have a project into IntelliJ (but the situation would be the same with any IDE).
This project use some .properties files that are putted inside the project itself. So I have the following structure (related only to the .properties files).
PROJECT-NAME
|
|
|-------> src
| |
| |
| |-------> config (it is a package)
| | |
| | |
| | |-------> mailer.properties
| |
| |
| |-------> log4j.properties
|
|
|-------> config.properties
So, as you can see from the previouse schema, I have 3 properties file into 3 different folders of the project:
config.properties: this is into the project root folder.
log4j.properties: this is into the /src/ folder of the project.
mailer.properties: this is into the config package inside the /src/ folder of the project.
At this stage I have created a build.xml Ant script that don't create the config package and that don't put all my properties file in the correct locations.
So my doubt is: how to handle this kind of situation?
I am thinking that I can create the config folder into the compile target and copy the properties file in the correct location before create the final jar file using the jar target.
Is it a good solution? How can I handle this kind of situation?