You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kenney Westerhof <fo...@neonics.com> on 2005/03/11 17:36:26 UTC

Re: howto parse a file, substituting variables?

On Fri, 11 Mar 2005, Caoilte O'Connor wrote:

Hi,

A possible solution is using <ant:filter/> and <ant:copy
filtering="true"/> in maven.xml, using the following format in
hibernate.properties:

hibernate.connection.url=@biz.db.url@@biz.db.test.database@

Greetings,

	Kenney


> Hi,
> I have defined all my maven used database properties by
> deriving them from variables in my project.properties file.
>
> Unfortunately I use hibernate and do not know of a way of
> inheriting the properties set in my project.properties file
> to my hibernate.properties file. It would make my life so
> much easier for deploying to different environments if I
> could.
>
> What I really want is a goal that will parse my
> hibernate.properties file with lines like,
>
> hibernate.connection.url=${biz.db.url}${biz.db.test.database}
>
> and replace the variables with the matching ones from my
> project.properties before copying the file as if it was a
> normal resources file.
>
> Is there any "right" way to do this?
>
> thanks,
>
> c
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: howto parse a file, substituting variables?

Posted by Caoilte O'Connor <li...@caoilte.org>.
Thanks,

With that and a little googling I was able to find my answer

I also added,

         <filtering>true</filtering>

to my resource in the project.xml file and used filter. 
Works a treat.

c

On Friday 11 March 2005 16:36, Kenney Westerhof wrote:
> On Fri, 11 Mar 2005, Caoilte O'Connor wrote:
>
> Hi,
>
> A possible solution is using <ant:filter/> and <ant:copy
> filtering="true"/> in maven.xml, using the following
> format in hibernate.properties:
>
> hibernate.connection.url=@biz.db.url@@biz.db.test.databas
>e@
>
> Greetings,
>
>  Kenney
>
> > Hi,
> > I have defined all my maven used database properties by
> > deriving them from variables in my project.properties
> > file.
> >
> > Unfortunately I use hibernate and do not know of a way
> > of inheriting the properties set in my
> > project.properties file to my hibernate.properties
> > file. It would make my life so much easier for
> > deploying to different environments if I could.
> >
> > What I really want is a goal that will parse my
> > hibernate.properties file with lines like,
> >
> > hibernate.connection.url=${biz.db.url}${biz.db.test.dat
> >abase}
> >
> > and replace the variables with the matching ones from
> > my project.properties before copying the file as if it
> > was a normal resources file.
> >
> > Is there any "right" way to do this?
> >
> > thanks,
> >
> > c
> >
> > -------------------------------------------------------
> >-------------- To unsubscribe, e-mail:
> > users-unsubscribe@maven.apache.org For additional
> > commands, e-mail: users-help@maven.apache.org
>
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
> ---------------------------------------------------------
>------------ To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org For additional
> commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org