maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <brett.por...@gmail.com>
Subject Re: [m2] Updating *.properties files according to environment
Date Sun, 06 Nov 2005 23:13:05 GMT
Yes, you can do this.

<filters>
  <filter>PROFILE_NAME-filters.properties</filter>
</filters>

can be added to each profile with a different set of substitutions for
DATABASE_DRIVER, etc.


On 11/4/05, Samuel Le Berrigaud <samuel.lb@gmail.com> wrote:
> Thanks Vincent,
>
> but I already looked at the profiles, It looks great except that it
> seems that I would have to create one set of files for each different
> profiles...
>
> What I would prefer, if we take the case of database connection is to
> have the one file I sent  in my previous mail:
>
> jdbc.driverClassName=@DATABASE_DRIVER@
> jdbc.url=@DATABASE_URL@
> jdbc.username=@DATABASE_USERNAME@
> jdbc.password=@DATABASE_PASSWORD@
>
> in the resources folder, and the properties would "overriden" by pom
> setting (in a profile) and user settings (in a profile) for each
> developer. It would be like intercepting the the copy of the file to
> the target and replacing properties with the one found in the active
> profile...
>
> Is there a way of doing that, or should I look about developing a new
> specific plugin ?
>
> SaM
>
> On 11/3/05, Vincent Siveton <vincent.siveton@gmail.com> wrote:
> > Hi Samuel,
> >
> > The Maven1 environment files (build.properties and project.properties) have
> > been replaced with a settings.xml file in Maven2.
> >
> > You could also define profiles to have customized builds.
> > http://maven.apache.org/guides/introduction/introduction-to-profiles.html
> >
> > Cheers,
> >
> > Vincent
> >
> > > -----Original Message-----
> > > From: Samuel Le Berrigaud [mailto:samuel.lb@gmail.com]
> > > Sent: Thursday, November 03, 2005 6:38 AM
> > > To: Maven Users List
> > > Subject: [m2] Updating *.properties files according to environment
> > >
> > > Hi,
> > >
> > > here is what I would like to do. I have some properties files for
> > > which values depends on the environement (development, test, live...)
> > > or per developer.
> > >
> > > Here is a basic example:
> > >
> > > jdbc.driverClassName=@DATABASE_DRIVER@
> > > jdbc.url=@DATABASE_URL@
> > > jdbc.username=@DATABASE_USERNAME@
> > > jdbc.password=@DATABASE_PASSWORD@
> > >
> > >
> > > What I would like is that, according to the environment, the variables
> > > of these files could be populated with right value (may be stored in
> > > pom.xml or settins.xml), and as far as possible keep a constant
> > > directory structure...
> > >
> > > I have seen the "profile" managment that m2 provides, but it look like
> > > that for what I do, I would have to have different directories for the
> > > different environments (profiles)...
> > >
> > > Is that possible using m2 ?
> > >
> > > Please tell me if I'm not clear enough...
> > >
> > > Thank you,
> > >
> > > --
> > > Samuel Le Berrigaud
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Samuel Le Berrigaud
>

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


Mime
View raw message