@Override
    @Nullable
    public MethodVisitor visitMethod(
        int access, String name, String descriptor, String signature, String[] exceptions) {
      if ((access & ~OPTIONAL_ACCESS) == (Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC)
          && name.equals("main")
          && descriptor.equals(MAIN_DESCRIPTOR)) {
        visitedMainClass = true;
      }
      return null;
    }
Accessors that main may or may not have.
jib-core/src/main/java/com/google/cloud/tools/jib/api/MainClassFinder.java