class GenerateUtil {

  public static void generateContract(MavenProject project, String contractOutput, String contractFileType,
      String type) {

    Map<String, Object> contractConfig = new HashMap<>();
    try {
      contractConfig.put("classpathUrls", project.getRuntimeClasspathElements());
    } catch (DependencyResolutionRequiredException e) {
      throw new RuntimeException("Failed to get runtime class elements", e);
    }
    contractConfig.put("outputDir", contractOutput);
    contractConfig.put("contractFileType", contractFileType);

    // TODO: support users to addParamCtx other getGenerator type soon
    ContractsGenerator contractGenerator = GeneratorFactory.getGenerator(ContractsGenerator.class, type);
    Objects.requireNonNull(contractGenerator).configure(contractConfig);

    contractGenerator.generate();
  }

}