I really need some advice here...
Here is my situation : I have a main maven project P1 with several resources to filter depending on target environment.
I would like to have my filter files in another project called P2, only made for hosting filter files (for this project and also other projects) in order to manage their configuration independently of P1.
1st question : Are there other people doing this ? Is it a good idea ?
Now my problem is how to filter the P1 resources using P2 filters. In my P1 POM, the use of directory "../P2" for the filter can't be used, because first I dislike this, and second, I use Jenkins for generation, and for Jenkins P1 and P2 are not in the same parent directory.
So I would like to make P1 refers to P2 as a jar dependency. But how to define that a Maven filter is not a file in a directory, but a resource in a jar dependency ? The only way I found for this is to use "Custom Resource Filters" of the Maven Resource Plugin (https://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html), in which I link to a P2 custom class doing the filtering.
This solution was working for war generation through Maven. BUT developers need to use Maven Eclipse WTP functionalities in order to deploy the project on their servers, and to use in particular on-the-fly resource filtering (without needing to run a maven build). And the "Custom Resource Filters" doesn't work with Eclipse WTP on-the-fly resource filtering.
So I don't really know what to do.. What would you advice me ? Or why don't you have this problem ?
Thanks a lot
Well, what i finally did was to keep the P2 project for filters. In my P2 project, I created a class hugely inspired from the default ResourceFilter class.
And then, in the P1 project, I call it through :
Local profile is for developer, while Server profile is to deploy on remote servers through Jenkins. It works quite well.