code: private void ensureMavenCompatibility(final ClassLoader classLoader) throws MojoExecutionException {
      Version mavenVersion = mavenVersionHelper.detectVersion(classLoader);
      if (mavenVersion == null) {
        // complain and continue
        log.error("Unable to determine Maven version");
      }
      else {
        log.debug("Detected Maven version: {}", mavenVersion);
        if (versionHelper.before(3).containsVersion(mavenVersion)) {
          throw new MojoExecutionException("Unsupported Maven version: " + mavenVersion);
        }
      }
    }
docs: Ensure Maven compatibility.  Requires Maven 3+