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>
>                        <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>JAVA_HOME</property>
>                                                        <message>"Please set
> JAVA_HOME"</message>
>                                                </requireProperty>
>                                        </rules>
>                                        <fail>true</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]
>
>

Reply via email to