You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Philip Wilder <ph...@nortel.com> on 2010/03/25 20:26:11 UTC

build.properties Question

Hello all,

I have been doing some research to determine if it is possible to load a
set of properties from a normal java properties file. The impression I
am getting it that it might be but only through a relatively obscure
plugin
(http://mvnrepository.com/artifact/org.sonatype.plugins/maven-properties
-plugin/0.0.2). 

The thing that really puzzles me is that I am led to believe this use to
be quite straightforward through the use of a build.properties file but
that functionality was lost in Maven 1. Can anyone tell me why this
functionality was removed or, better yet, if there is a flag to turn it
back on?

Thanks,

Philip Wilder | Software Designer
pwilder@ciena.com | 3500 Carling Ave. | Ottawa, Ontario K2H 8E9 Canada
Direct +1.613.763.8548 



Re: build.properties Question

Posted by Manfred Moser <ma...@mosabuam.com>.
You are correct. The recommended way is to use the property tag in
pom.,xml, settings.xml and within profiles and so on. This is a much more
powerful mechanism with built in inheritance, overloading, activation and
so on.

If you still insist on using external .properties file the plugin you
mention is the way to go.

manfred

> Hello all,
>
> I have been doing some research to determine if it is possible to load a
> set of properties from a normal java properties file. The impression I
> am getting it that it might be but only through a relatively obscure
> plugin
> (http://mvnrepository.com/artifact/org.sonatype.plugins/maven-properties
> -plugin/0.0.2).
>
> The thing that really puzzles me is that I am led to believe this use to
> be quite straightforward through the use of a build.properties file but
> that functionality was lost in Maven 1. Can anyone tell me why this
> functionality was removed or, better yet, if there is a flag to turn it
> back on?
>
> Thanks,
>
> Philip Wilder | Software Designer
> pwilder@ciena.com | 3500 Carling Ave. | Ottawa, Ontario K2H 8E9 Canada
> Direct +1.613.763.8548
>
>
>


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


RE: build.properties Question

Posted by su...@wipro.com.
Filtering -- is that what you mean. I guess that is available in Maven 2
here [1]

[1] -
http://maven.apache.org/guides/getting-started/index.html#How_do_I_filte
r_resource_files

Subir 

-----Original Message-----
From: Philip Wilder [mailto:philipwi@nortel.com] 
Sent: Friday, March 26, 2010 12:56 AM
To: users@maven.apache.org
Subject: build.properties Question

Hello all,

I have been doing some research to determine if it is possible to load a
set of properties from a normal java properties file. The impression I
am getting it that it might be but only through a relatively obscure
plugin
(http://mvnrepository.com/artifact/org.sonatype.plugins/maven-properties
-plugin/0.0.2). 

The thing that really puzzles me is that I am led to believe this use to
be quite straightforward through the use of a build.properties file but
that functionality was lost in Maven 1. Can anyone tell me why this
functionality was removed or, better yet, if there is a flag to turn it
back on?

Thanks,

Philip Wilder | Software Designer
pwilder@ciena.com | 3500 Carling Ave. | Ottawa, Ontario K2H 8E9 Canada
Direct +1.613.763.8548 



Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

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


RE: build.properties Question

Posted by Philip Wilder <ph...@nortel.com>.
Hi Sebb, 

Haven't seen that one before thanks. This still feels like overkill for
what seems like a simple operation but perhaps it might be a necessary
evil. 

Philip

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Sunday, March 28, 2010 10:41 PM
To: Maven Users List
Subject: Re: build.properties Question

On 26/03/2010, Philip Wilder <ph...@nortel.com> wrote:
> Thanks Wayne,
>
>  The nature of my problem is that I am attempting to integrate two  
> different builds processes with the first build generating a 
> properties  file to modify the second maven build.
>
>  The current solution is to use scripts to pass in the values on the  
> commandline to the maven build. I'm not terribly fond of this approach

> because it means some of the work is being done outside of maven and  
> requires an environment capable of running sh files (yes we could 
> create  a corresponding .bat file). Unfortunately, as I understand it,

> this  continues to be our best option because we are altering build 
> properties  which are read before plugin execution (meaning the 
> properties plugin I  mentioned earlier won't work for us).
>
>  I suppose technically we could try to create a settings.xml file but 
> I  would be concerned that this has the potential to interfere with 
> the  settings.xml for a particular users environment.

Have you seen this?

http://www.gxdeveloperweb.com/Blogs/Bram-de-Kruijff/Maven-secrets-Dynami
c-Maven-properties-with-Beanshell.htm

>
>  Philip
>
>
>  -----Original Message-----
>  From: Wayne Fay [mailto:waynefay@gmail.com]
>  Sent: Thursday, March 25, 2010 5:54 PM
>  To: Maven Users List
>  Subject: Re: build.properties Question
>
>  > that functionality was lost in Maven 1. Can anyone tell me why this

> > functionality was removed or, better yet, if there is a flag to turn

> > it back on?
>
>  There is no flag, and I can't imagine one will be added. Maven simply

> does not use properties files. If you must use properties files, then

> you must use a Maven plugin or Ant, Ivy, etc.
>
>  Jason van Zyl has previously responded to this question:
>
http://old.nabble.com/Making-properties-accessible-in-pom.xml-ts8996414.
>  html
>
>  Make sure you read Stephen Connolly's response in that same thread  
> before getting too deep into your usage of any plugins to read those  
> properties files, too.
>
>  If you're planning on using Maven long-term, you really need to 
> migrate  away from properties files, they're just not supported.
>
>  Wayne
>
>  ---------------------------------------------------------------------
>  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
>
>

---------------------------------------------------------------------
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


RE: build.properties Question

Posted by Philip Wilder <ph...@nortel.com>.
Thanks Stephen, 

Caught that one already per my properties plugin won't work comment. 

Looks like I am stuck doing it the hard way.

Philip

-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
Sent: Monday, March 29, 2010 2:47 AM
To: Maven Users List
Subject: Re: build.properties Question

On 29 March 2010 02:40, sebb <se...@gmail.com> wrote:

> On 26/03/2010, Philip Wilder <ph...@nortel.com> wrote:
> > Thanks Wayne,
> >
> >  The nature of my problem is that I am attempting to integrate two  
> > different builds processes with the first build generating a 
> > properties  file to modify the second maven build.
> >
> >  The current solution is to use scripts to pass in the values on the

> > commandline to the maven build. I'm not terribly fond of this 
> > approach  because it means some of the work is being done outside of

> > maven and  requires an environment capable of running sh files (yes 
> > we could create  a corresponding .bat file). Unfortunately, as I 
> > understand it, this  continues to be our best option because we are 
> > altering build properties  which are read before plugin execution 
> > (meaning the properties plugin I  mentioned earlier won't work for
us).
> >
> >  I suppose technically we could try to create a settings.xml file 
> > but I  would be concerned that this has the potential to interfere 
> > with the  settings.xml for a particular users environment.
>
> Have you seen this?
>
>
> http://www.gxdeveloperweb.com/Blogs/Bram-de-Kruijff/Maven-secrets-Dyna
> mic-Maven-properties-with-Beanshell.htm
>
>
I shall repeat my 18 month old comment with respect to this plugin:

> Beware, that plugin suffers from a fatal flaw:
>
> Plugins execute after the build plan has been constructed.
>
> Thus it can only provide properties for things which do not affect the
build
> plan.
>
> So, while you'll get some mileage out of that plugin.... ultimately 
> you'll end up frustrated when you hit one of the places where property
subsitution
> takes place during determination of the build plan.
>
> Also, the property substitution will only take place *when* the plugin

> is run, so if you invoke another plugin directly outside of a 
> lifecycle goal, you'll get no substitution...

-Stephen


> >
> >  Philip
> >
> >
> >  -----Original Message-----
> >  From: Wayne Fay [mailto:waynefay@gmail.com]
> >  Sent: Thursday, March 25, 2010 5:54 PM
> >  To: Maven Users List
> >  Subject: Re: build.properties Question
> >
> >  > that functionality was lost in Maven 1. Can anyone tell me why 
> > this  > functionality was removed or, better yet, if there is a flag

> > to turn  > it back on?
> >
> >  There is no flag, and I can't imagine one will be added. Maven 
> > simply  does not use properties files. If you must use properties 
> > files, then  you must use a Maven plugin or Ant, Ivy, etc.
> >
> >  Jason van Zyl has previously responded to this question:
> >  
> > http://old.nabble.com/Making-properties-accessible-in-pom.xml-ts8996
> > 414
> .
> >  html
> >
> >  Make sure you read Stephen Connolly's response in that same thread

> > before getting too deep into your usage of any plugins to read those

> > properties files, too.
> >
> >  If you're planning on using Maven long-term, you really need to 
> > migrate  away from properties files, they're just not supported.
> >
> >  Wayne
> >
> >  
> > --------------------------------------------------------------------
> > -  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
> >
> >
>
> ---------------------------------------------------------------------
> 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


Re: build.properties Question

Posted by Stephen Connolly <st...@gmail.com>.
On 29 March 2010 02:40, sebb <se...@gmail.com> wrote:

> On 26/03/2010, Philip Wilder <ph...@nortel.com> wrote:
> > Thanks Wayne,
> >
> >  The nature of my problem is that I am attempting to integrate two
> >  different builds processes with the first build generating a properties
> >  file to modify the second maven build.
> >
> >  The current solution is to use scripts to pass in the values on the
> >  commandline to the maven build. I'm not terribly fond of this approach
> >  because it means some of the work is being done outside of maven and
> >  requires an environment capable of running sh files (yes we could create
> >  a corresponding .bat file). Unfortunately, as I understand it, this
> >  continues to be our best option because we are altering build properties
> >  which are read before plugin execution (meaning the properties plugin I
> >  mentioned earlier won't work for us).
> >
> >  I suppose technically we could try to create a settings.xml file but I
> >  would be concerned that this has the potential to interfere with the
> >  settings.xml for a particular users environment.
>
> Have you seen this?
>
>
> http://www.gxdeveloperweb.com/Blogs/Bram-de-Kruijff/Maven-secrets-Dynamic-Maven-properties-with-Beanshell.htm
>
>
I shall repeat my 18 month old comment with respect to this plugin:

> Beware, that plugin suffers from a fatal flaw:
>
> Plugins execute after the build plan has been constructed.
>
> Thus it can only provide properties for things which do not affect the
build
> plan.
>
> So, while you'll get some mileage out of that plugin.... ultimately you'll
> end up frustrated when you hit one of the places where property
subsitution
> takes place during determination of the build plan.
>
> Also, the property substitution will only take place *when* the plugin is
> run, so if you invoke another plugin directly outside of a lifecycle goal,
> you'll get no substitution...

-Stephen


> >
> >  Philip
> >
> >
> >  -----Original Message-----
> >  From: Wayne Fay [mailto:waynefay@gmail.com]
> >  Sent: Thursday, March 25, 2010 5:54 PM
> >  To: Maven Users List
> >  Subject: Re: build.properties Question
> >
> >  > that functionality was lost in Maven 1. Can anyone tell me why this
> >  > functionality was removed or, better yet, if there is a flag to turn
> >  > it back on?
> >
> >  There is no flag, and I can't imagine one will be added. Maven simply
> >  does not use properties files. If you must use properties files, then
> >  you must use a Maven plugin or Ant, Ivy, etc.
> >
> >  Jason van Zyl has previously responded to this question:
> >  http://old.nabble.com/Making-properties-accessible-in-pom.xml-ts8996414
> .
> >  html
> >
> >  Make sure you read Stephen Connolly's response in that same thread
> >  before getting too deep into your usage of any plugins to read those
> >  properties files, too.
> >
> >  If you're planning on using Maven long-term, you really need to migrate
> >  away from properties files, they're just not supported.
> >
> >  Wayne
> >
> >  ---------------------------------------------------------------------
> >  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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: build.properties Question

Posted by sebb <se...@gmail.com>.
On 26/03/2010, Philip Wilder <ph...@nortel.com> wrote:
> Thanks Wayne,
>
>  The nature of my problem is that I am attempting to integrate two
>  different builds processes with the first build generating a properties
>  file to modify the second maven build.
>
>  The current solution is to use scripts to pass in the values on the
>  commandline to the maven build. I'm not terribly fond of this approach
>  because it means some of the work is being done outside of maven and
>  requires an environment capable of running sh files (yes we could create
>  a corresponding .bat file). Unfortunately, as I understand it, this
>  continues to be our best option because we are altering build properties
>  which are read before plugin execution (meaning the properties plugin I
>  mentioned earlier won't work for us).
>
>  I suppose technically we could try to create a settings.xml file but I
>  would be concerned that this has the potential to interfere with the
>  settings.xml for a particular users environment.

Have you seen this?

http://www.gxdeveloperweb.com/Blogs/Bram-de-Kruijff/Maven-secrets-Dynamic-Maven-properties-with-Beanshell.htm

>
>  Philip
>
>
>  -----Original Message-----
>  From: Wayne Fay [mailto:waynefay@gmail.com]
>  Sent: Thursday, March 25, 2010 5:54 PM
>  To: Maven Users List
>  Subject: Re: build.properties Question
>
>  > that functionality was lost in Maven 1. Can anyone tell me why this
>  > functionality was removed or, better yet, if there is a flag to turn
>  > it back on?
>
>  There is no flag, and I can't imagine one will be added. Maven simply
>  does not use properties files. If you must use properties files, then
>  you must use a Maven plugin or Ant, Ivy, etc.
>
>  Jason van Zyl has previously responded to this question:
>  http://old.nabble.com/Making-properties-accessible-in-pom.xml-ts8996414.
>  html
>
>  Make sure you read Stephen Connolly's response in that same thread
>  before getting too deep into your usage of any plugins to read those
>  properties files, too.
>
>  If you're planning on using Maven long-term, you really need to migrate
>  away from properties files, they're just not supported.
>
>  Wayne
>
>  ---------------------------------------------------------------------
>  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
>
>

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


RE: build.properties Question

Posted by Philip Wilder <ph...@nortel.com>.
Thanks Wayne,

The nature of my problem is that I am attempting to integrate two
different builds processes with the first build generating a properties
file to modify the second maven build. 

The current solution is to use scripts to pass in the values on the
commandline to the maven build. I'm not terribly fond of this approach
because it means some of the work is being done outside of maven and
requires an environment capable of running sh files (yes we could create
a corresponding .bat file). Unfortunately, as I understand it, this
continues to be our best option because we are altering build properties
which are read before plugin execution (meaning the properties plugin I
mentioned earlier won't work for us). 

I suppose technically we could try to create a settings.xml file but I
would be concerned that this has the potential to interfere with the
settings.xml for a particular users environment. 

Philip

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Thursday, March 25, 2010 5:54 PM
To: Maven Users List
Subject: Re: build.properties Question

> that functionality was lost in Maven 1. Can anyone tell me why this 
> functionality was removed or, better yet, if there is a flag to turn 
> it back on?

There is no flag, and I can't imagine one will be added. Maven simply
does not use properties files. If you must use properties files, then
you must use a Maven plugin or Ant, Ivy, etc.

Jason van Zyl has previously responded to this question:
http://old.nabble.com/Making-properties-accessible-in-pom.xml-ts8996414.
html

Make sure you read Stephen Connolly's response in that same thread
before getting too deep into your usage of any plugins to read those
properties files, too.

If you're planning on using Maven long-term, you really need to migrate
away from properties files, they're just not supported.

Wayne

---------------------------------------------------------------------
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


Re: build.properties Question

Posted by Wayne Fay <wa...@gmail.com>.
> that functionality was lost in Maven 1. Can anyone tell me why this
> functionality was removed or, better yet, if there is a flag to turn it
> back on?

There is no flag, and I can't imagine one will be added. Maven simply
does not use properties files. If you must use properties files, then
you must use a Maven plugin or Ant, Ivy, etc.

Jason van Zyl has previously responded to this question:
http://old.nabble.com/Making-properties-accessible-in-pom.xml-ts8996414.html

Make sure you read Stephen Connolly's response in that same thread
before getting too deep into your usage of any plugins to read those
properties files, too.

If you're planning on using Maven long-term, you really need to
migrate away from properties files, they're just not supported.

Wayne

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