@Nullable
  public static String getProperty(
      String propertyName, @Nullable MavenProject project, @Nullable MavenSession session) {
    if (session != null && session.getUserProperties().containsKey(propertyName)) {
      return session.getUserProperties().getProperty(propertyName);
    }
    if (project != null && project.getProperties().containsKey(propertyName)) {
      return project.getProperties().getProperty(propertyName);
    }
    if (session != null && session.getSystemProperties().containsKey(propertyName)) {
      return session.getSystemProperties().getProperty(propertyName);
    }
    return null;
  }
Gets a property with the given name. First checks for a Maven user property (-D commandline
argument), then checks for a property defined in the POM, then checks for a Maven system
property, then returns null if none of those are defined.

@param propertyName the name of the property
@param project the Maven project
@param session the Maven session
@return the value of the property, or null if not defined
jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java