code: protected static Object getField(String fieldName, Object mojo) throws Exception {
          Field field = null;
          try {
              field = mojo.getClass().getDeclaredField(fieldName);
          } catch (NoSuchFieldException ex) {
              // Ignore exception and try superclass.
              field = mojo.getClass().getSuperclass().getDeclaredField(fieldName);
          }
          field.setAccessible(true);
          return field.get(mojo);
      }
docs: Gets the value of the field. This is an alternative to invoking a get
  method.
  
  @param fieldName
  Name of the field to get
  @param mojo
  Mojo
  @return Value of the field
  @throws Exception
  If getting the field value using relection goes wrong