views:

656

answers:

1

I have a web project that is built with maven. I have the project in eclipse as a WTP project (generated using mvn eclipse:eclipse), and it is associated with a glassfish server, also configured in eclipse. I can publish to the server. The problem is, we use maven to do some filtering in one of the configuration xml files in the webapp (faces-config.xml) so it replaces properties within the xml file with properties from maven's pom.

I am not averse to re-defining those properties in eclipse if I have to since there is only one or two, and they haven't changed in a while, but hard coding the value in faces-config.xml is not an option because it is also included in another project with different values, thus the need for filtering.

Is there a way for me to customize the publish step of the WTP within eclipse so that it performs that filtering before pushing the changes to the deploy directory?

+1  A: 

If you are not using the m2eclipse plugin, there might be a solution described in Getting Maven and Eclipse to work together to filter resources. I'm not sure it will work with the WTP but worth the read!

Pascal Thivent
hrm, I'll have to look into that. I actually wrote a blog post similar to that one about getting eclipse to perform maven filtering, but I'm not sure how to get that hooked into the WTP plugin publish step. I have eclipse building into my target directory and perform filtering with the working sets and all that, but WTP doesn't seem to pull from there when it publishes to the server configured within eclipse. If I figure something else out, I'll post the answer here. Thanks for the response.
digitaljoel
Now that I think about it again, I remember I was using the maven jetty plugin, not the WTP. So you might be right and I'm not sure it'll work with the wTP.
Pascal Thivent