3
votes

Is there any way I can get Eclipse WTP to do token substitution on publish/deployment assembly?

I'd like to have tokens like ${hostname}, ${environment} etc. in web.xml or a properties file, substituted at build time from some context.

A specific example from persistence.xml:

<property name="javax.persistence.jdbc.url" value="${jdbc.url}"/>

Is there any way to do this with Eclipse/WTP without having Maven manage my build? More precisely, can I have WTP publish changes incrementally without rebuilding and redeploying every single class/resource in the WAR to the server?

1
Why without Maven? This is a snap with Maven filtering. - Michael-O
I have two good main reasons for avoiding Maven: it's heavyweight for such a simple webapp (JARs just checked into WEB-INF/lib directly) and I don't want to have to do a full rebuild to push changes out to individual resources - I like that WTP can build and publish incrementally. - wrschneider

1 Answers

0
votes

I don't believe there is any existing way to hook the WTP publishing mechanism from a user's perspective. You could however create an Eclipse plugin to hook the WTP publishing (even incremental publishing) process and install it into your host eclipse environment.