RE: Does requireProperty consider system environment variables?

2008-12-11 Thread Brian E. Fox
This is only looking at properties in the POM/Model. One way to make it
work would be to define in your pom hierarchy:

javaHome${env.java_home}/javaHome

And then check that javaHome is set.

Otherwise, there would need to be a new custom rule that would look
specifically at env-vars, which admittedly would be handy. Actually on
second thought, try checking if env.java_home works if you specify that
in the enforcer config.

-Original Message-
From: Jaikiran [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2008 9:34 AM
To: users@maven.apache.org
Subject: Re: Does requireProperty consider system environment variables?


Thanks, That answers my question :-)


Stephen Connolly-2 wrote:
 
 Write a custom enforcer rule!
 
 


-- 
View this message in context:
http://www.nabble.com/Does-requireProperty-consider-system-environment-v
ariables--tp20936086p20936504.html
Sent from the Maven - Users mailing list archive at Nabble.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]



RE: Does requireProperty consider system environment variables?

2008-12-11 Thread Brian E. Fox
Do'h. Guess I should read the whole thread before I reply ;-)

-Original Message-
From: Jaikiran [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 11, 2008 1:48 AM
To: users@maven.apache.org
Subject: Re: Does requireProperty consider system environment variables?


Great, the intermediate property trick works! 

Here's what i did:
properties
  java.home${JAVA_HOME}/java.home
/properties 

Then in the enforcer plugin:

requireProperty
  propertyjava.home/property
 messagePlease set JAVA_HOME/message
/requireProperty

Thanks for the help :)


Jaikiran wrote:
 
 Matthew,
 
 That's a good idea :)
 
 Let me give it a try and see how it behaves. Will post the outcome.
 
 

-- 
View this message in context:
http://www.nabble.com/Does-requireProperty-consider-system-environment-v
ariables--tp20936086p20950262.html
Sent from the Maven - Users mailing list archive at Nabble.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]



Re: Does requireProperty consider system environment variables?

2008-12-10 Thread Stephen Connolly
Write a custom enforcer rule!

2008/12/10 Jaikiran [EMAIL PROTECTED]


 I am using Maven-2.0.9 and the enforcer plugin within my pom
 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/index.html
 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/index.html

 Within this plugin i am using the requireProperty rule to ensure that a
 environment property is set by the user before running mvn

 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/requireProperty.html

 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/requireProperty.html

 Here's the pom:

plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-enforcer-plugin/artifactId
executions
execution
idenforce-property/id
goals
goalenforce/goal
/goals
configuration
rules

requireProperty

  propertyJAVA_HOME/property
messagePlease set
 JAVA_HOME/message
/requireProperty
/rules
failtrue/fail
/configuration
  /execution
/executions
/plugin


 This rule always fails even if the user has set the JAVA_HOME from the
 command prompt:
 export JAVA_HOME=/home/me/Java

 Does this rule, consider the system level environment variables? I could
 test the enforcer rule successfully against a property that was set within
 the pom. Is there any other way i can enforce the JAVA_HOME to be set?
 --
 View this message in context:
 http://www.nabble.com/Does-requireProperty-consider-system-environment-variables--tp20936086p20936086.html
 Sent from the Maven - Users mailing list archive at Nabble.com.


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




Re: Does requireProperty consider system environment variables?

2008-12-10 Thread Jaikiran

Thanks, That answers my question :-)


Stephen Connolly-2 wrote:
 
 Write a custom enforcer rule!
 
 


-- 
View this message in context: 
http://www.nabble.com/Does-requireProperty-consider-system-environment-variables--tp20936086p20936504.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Does requireProperty consider system environment variables?

2008-12-10 Thread Matthew Jaskula
I would have thought that 'env.JAVA_HOME' would have worked, but it appears
that it does not.

If you don't want to write a rule, it looks like you can workaround with an
intermediate property. Just set a property to the value of the environment
variable and enforce that property. A tiny bit more confusing, but it's less
code, and less to change when support for this is added to the plugin.

Example:

..
properties
  javaHome${env.JAVA_HOME}/javaHome
/properties
..
plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-enforcer-plugin/artifactId
  executions
execution
  idenforce-property/id
  goals
goalenforce/goal
  /goals
  configuration
rules
  requireProperty
propertyjavaHome/property
  /requireProperty
/rules
failtrue/fail
  /configuration
/execution
  /executions
/plugin
..

--
Matthew Jaskula
[EMAIL PROTECTED]


 From: Stephen Connolly [EMAIL PROTECTED]
 Reply-To: Maven Users List users@maven.apache.org
 Date: Wed, 10 Dec 2008 14:25:13 +
 To: Maven Users List users@maven.apache.org
 Subject: Re: Does requireProperty consider system environment variables?
 
 Write a custom enforcer rule!
 
 2008/12/10 Jaikiran [EMAIL PROTECTED]
 
 
 I am using Maven-2.0.9 and the enforcer plugin within my pom
 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/index.html
 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/index.html
 
 Within this plugin i am using the requireProperty rule to ensure that a
 environment property is set by the user before running mvn
 
 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/requireProperty.h
 tml
 
 http://maven.apache.org/plugins/maven-enforcer-plugin/rules/requireProperty.h
 tml
 
 Here's the pom:
 
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-enforcer-plugin/artifactId
executions
execution
idenforce-property/id
goals
goalenforce/goal
/goals
configuration
rules
 
requireProperty
 
  propertyJAVA_HOME/property
messagePlease set
 JAVA_HOME/message
/requireProperty
/rules
failtrue/fail
/configuration
  /execution
/executions
/plugin
 
 
 This rule always fails even if the user has set the JAVA_HOME from the
 command prompt:
 export JAVA_HOME=/home/me/Java
 
 Does this rule, consider the system level environment variables? I could
 test the enforcer rule successfully against a property that was set within
 the pom. Is there any other way i can enforce the JAVA_HOME to be set?
 --
 View this message in context:
 http://www.nabble.com/Does-requireProperty-consider-system-environment-variab
 les--tp20936086p20936086.html
 Sent from the Maven - Users mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment
to it is privileged, confidential and protected from disclosure.  If the 
reader of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the intended 
recipient, you are hereby notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify the 
sender immediately by replying to the message, and please delete
it from your system. Thank you.  NYSE Euronext, Inc.


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



Re: Does requireProperty consider system environment variables?

2008-12-10 Thread Jaikiran

Matthew,

That's a good idea :)

I had thought about it once, but then i guessed that if the JAVA_HOME is not
set, then the intermediate property would be set to the literal 
${env.JAVA_HOME} by the following:

properties
  javaHome${env.JAVA_HOME}/javaHome
/properties 

Let me give it a try and see how it behaves. Will post the outcome.



Matthew Jaskula wrote:
 
 I would have thought that 'env.JAVA_HOME' would have worked, but it
 appears
 that it does not.
 
 If you don't want to write a rule, it looks like you can workaround with
 an
 intermediate property. Just set a property to the value of the environment
 variable and enforce that property. A tiny bit more confusing, but it's
 less
 code, and less to change when support for this is added to the plugin.
 
 Example:
 
 ..
 properties
   javaHome${env.JAVA_HOME}/javaHome
 /properties
 ..
 plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-enforcer-plugin/artifactId
   executions
 execution
   idenforce-property/id
   goals
 goalenforce/goal
   /goals
   configuration
 rules
   requireProperty
 propertyjavaHome/property
   /requireProperty
 /rules
 failtrue/fail
   /configuration
 /execution
   /executions
 /plugin
 ..
 
 --
 Matthew Jaskula
 [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Does-requireProperty-consider-system-environment-variables--tp20936086p20949993.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Does requireProperty consider system environment variables?

2008-12-10 Thread Jaikiran

Great, the intermediate property trick works! 

Here's what i did:
properties
  java.home${JAVA_HOME}/java.home
/properties 

Then in the enforcer plugin:

requireProperty
  propertyjava.home/property
 messagePlease set JAVA_HOME/message
/requireProperty

Thanks for the help :)


Jaikiran wrote:
 
 Matthew,
 
 That's a good idea :)
 
 Let me give it a try and see how it behaves. Will post the outcome.
 
 

-- 
View this message in context: 
http://www.nabble.com/Does-requireProperty-consider-system-environment-variables--tp20936086p20950262.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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