mvn validate: Usage, Options & Common CI Errors
The first phase Maven runs - validate the POM before anything else.
validate is the first phase of the Maven default lifecycle. It checks that the project is correct and that all necessary information is available, making it a fast way to catch a malformed POM in CI before a long build.
What it does
validate verifies the project structure and POM are valid and that required information (such as parent POMs and properties) can be resolved. Running any later phase (compile, test, package) runs validate first, but invoking it alone gives a quick correctness check.
Common usage
mvn validate
mvn -q validate # quiet: only warnings/errors
mvn help:evaluate -Dexpression=project.version -q -DforceStdoutCommon error in CI (and the fix)
Symptom: "Non-resolvable parent POM ... and 'parent.relativePath' points at no local POM". Cause: the parent POM is not in the local repo and relativePath defaults to ../pom.xml, which does not exist in a single-module checkout. Fix: set an empty relativePath so Maven resolves the parent from the repository: add <relativePath/> inside the <parent> element, and ensure the parent is published to a reachable repository.