Set <inherited>false</inherited> in the execution IIRC (I forget the exact location, but that should get you started)
-----Original Message----- From: Matthew Flower [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 02, 2007 4:37 PM To: [email protected] Subject: Enforce environment variable without transitive dependencies? I am trying to ensure that a user always specifies a particular environment of either "dev", "qa", or "prod". I've been doing so by doing: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <executions> <execution> <id>enforce-property</id> <goals> <goal>enforce</goal> </goals> <phase>validate</phase> <inherited>false</inherited> <configuration> <rules> <requireProperty> <property>env</property> <message> Missing environment -- please call maven with an environment such as: mvn -Denv=dev clean install mvn -Denv=qa clean install mvn -Denv=prod clean install </message> <regex>dev|qa|prod</regex> <regexMessage> Invalid environment, valid values are dev, qa, or prod </regexMessage> </requireProperty> </rules> <fail>true</fail> </configuration> </execution> </executions> </plugin> However, this has created a problem. When I use the project which contains this pom as a dependency in another project, it will enforce the requirement on this new pom. Has anyone else found a way around this? Thanks, Matt --------------------------------------------------------------------- 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]
