I’m using Maven 3.0.3. If someone runs a Maven task that is inclusive of the “verify” phase, I want to ensure that a property, “tomcat.manager.url” is defined, and throw an error if it isn’t. However, if someone hasn’t run a command that includes verify (e.g. mvn test), I don’t want to throw any error.
How do I do this?
Thanks, – Dave
You could set the enforcer plugin (docs) to execute during the “verify” phase with a rule that requires that plugin to be set, the configuration would look something like this:
Since the plugin will only execute during the verify phase, the check won’t happen unless you are running a build that reaches that phase.