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>
>   <groupId>org.apache.maven.plugins</groupId>
>   <artifactId>maven-enforcer-plugin</artifactId>
>   <executions>
>     <execution>
>       <id>enforce-property</id>
>       <goals>
>         <goal>enforce</goal>
>       </goals>
>       <configuration>
>         <rules>
>           <requireProperty>
>             <property>javaHome</property>
>           </requireProperty>
>         </rules>
>         <fail>true</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]

Reply via email to