I’m building a Java ZK/Spring/Hibernate web app using the MyEclipse IDE. I test the code locally using the MyEclipse Tomcat server.
With my Spring bean configuration I have extracted the machine specific settings into a separate ‘environ.properties’ parameters file, like…
site.url=http://localhost:8080/skap/
mail.sender.host=smtp.gggg.com
mail.sender.port=25
mail.sender.username=yyfgfgft@gggg.com
mail.sender.from=yyfgfgft@gggg.com
database.url=jdbc:mysql://localhost:3306/skap
database.uid=root
database.pwd=root
In my Spring context file I use the property place holder configurer bean to push these machine specific settings into various bean properties, like…
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:environ.properties</value>
</property>
</bean>
<bean id="EnvironManager" class="com.eis.environ.EnvironManager">
<property name="siteURL" value="${site.url}" />
<property name="mailSenderFrom" value="${mail.sender.from}" />
</bean>
<bean id="MailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="${mail.sender.host}"/>
<property name="port" value="${mail.sender.port}"/>
<property name="username" value="${mail.sender.username}"/>
<property name="password" value="${mail.sender.password}"/>
</bean>
In order to deploy my test app from my local development test machine to a test server I want to deploy the code with a different ‘environ.properties’ file that reflects the settings for the remote test machine. For this to work I have to exclude my properties file from the build process, and instead include this as a separate deliverable.
Can somebody advise me how I can achieve this so that the ‘environ.properties’ is not automatically included in the build process, and that perhaps as part of some post build step I can copy the ‘environ.properties’ file to the MyEclipse Tomcat server?
TIA