Due to the way Maven forks builds etc, I don't think you can ever
safely assume that System properties are going to be available to a
specific plugin in your build. Instead, you should be passing
properties into plugins directly, or writing code in your plugin to
access Maven properties using the Maven API.

I could be wrong here, but I have written some plugins, and I've never
assumed that System properties would be around for my plugins to use.

You could also try downloading the org.apache.maven.plugins.* code and
grepping for System.getProperty, but I doubt you'll find any
references to it. This is a good indication that you probably don't
want to be doing this or you're doing something wrong.

Wayne

On 1/15/08, Matthew Tordoff <[EMAIL PROTECTED]> wrote:
> Hi Simon,
>
> Sorry for the confusion, but I am not trying to set a basic property,
> but a JVM System Property. A property which would be accessible from the
> Java code using System.getProperty("PropertyName");
>
> I then want that property to be available to every plugin I execute.
>
> Matt
>
> -----Original Message-----
> From: Simon Kitching [mailto:[EMAIL PROTECTED]
> Sent: 15 January 2008 12:39
> To: Maven Users List; Matthew Tordoff
> Subject: RE: Setting Java System property
>
> ---- Matthew Tordoff <[EMAIL PROTECTED]> schrieb:
> > Thanks for that but I have already looked at the appropriate
> > documentation. I have tried setting the system property in all of
> > those locations and for some reason none of the settings are passed
> > through. I did find a JIRA bug opened against this problem somewhere,
> > and thus am guessing this functionality isn't yet available.
>
> Are you trying to set a "global" property, or one specific to just a
> particular plugin?
>
> You appear to be trying to do the latter by nesting your properties info
> inside a <configuration> tag. However the page I referred you to says
> about configuration:
>  The configuration as DOM object.
> which strongly implies to me that this is only interpreted by the
> plugin, and you cannot assume that maven looks in here, ie the plugin
> alone is responsible for interpreting the contents. I could be wrong
> here, but don't think so..
>
> Setting properties in a pom which are global to all stuff in the pom
> (and child poms) is trivial, and definitely works when *not* nested
> within a <configuration> element (as documented in the page I referred
> you to):
>
> <project>
>  ...
>  <properties>
>   <foo>fooval</foo>
>  </properties>
> </project>
>
> It also works in settings.xml, but you do need to be sure that the
> profile it is defined within is active..
>
> Regards,
> Simon
>
>
>
>
> The content of this e-mail is confidential and may be privileged. It may be 
> read, copied and used only by the intended recipient and may not be 
> disclosed, copied or distributed. If you received this email in error, please 
> contact the sender immediately by return e-mail or by telephoning +44 20 7260 
> 2000, delete it and do not disclose its contents to any person. You should 
> take full responsibility for checking this email for viruses. Markit reserves 
> the right to monitor all e-mail communications through its network.
> Markit and its affiliated companies make no warranty as to the accuracy or 
> completeness of any information contained in this message and hereby exclude 
> any liability of any kind for the information contained herein. Any opinions 
> expressed in this message are those of the author and do not necessarily 
> reflect the opinions of Markit.
> For full details about Markit, its offerings and legal terms and conditions, 
> please see Markit's website at http://www.markit.com <http://www.markit.com/> 
> .
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to