hibernate - specify db password in ant build file -


my webapp has hibernate config file specifies db password follows:

  <property name="hibernate.connection.password">p1ssw2rd</property> 
has ant build file, possible specify db password @ build time , pass hibernate?

      <target name="init-development">        <property name="databasepassword" value="xxxx"/>     </target>  

you can create template hibernate config password label this:

<property name="hibernate.connection.password">@@hiber_password@@</property> 

and when ant starts build, copy template config on real hibernate config, applying replacement password label real db password specified in build.xml. that:

<copy file="${src.dir}/hibernate-config.xml.tpl"          tofile="${src.dir}/hibernate-config.xml">     <filterchain>            <replacetokens>                <token key="@@hiber_password@@"                       value="${databasepassword}"/>            </replacetokens>     </filterchain> </copy> 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -