private static void commonConfig()

in toolkit-maven-plugin/src/main/java/org/apache/servicecomb/toolkit/plugin/GenerateUtil.java [175:199]


  private static void commonConfig(CodegenConfigurator configurator, ServiceConfig service) {

    configurator
        .setGeneratorName(service.getMicroServiceFramework())
        .setGroupId(service.getGroupId())
        .setArtifactId(service.getArtifactId())
        .setModelPackage(service.getPackageName())
        .addAdditionalProperty("mainClassPackage", Optional.ofNullable(service.getPackageName()).orElse(""))
        .setArtifactVersion(service.getArtifactVersion())
        .addAdditionalProperty(ProjectMetaConstant.SERVICE_TYPE,
            Optional.ofNullable(service.getServiceType()).orElse("all"))
        .addAdditionalProperty(ProjectMetaConstant.SERVICE_ID, service.getServiceId());

    Optional.ofNullable(service.getProviderServiceId()).ifPresent(providerServiceId -> configurator
        .addAdditionalProperty(ProjectMetaConstant.PROVIDER_SERVICE_ID, service.getProviderServiceId()));

    if (MicroServiceFramework.SERVICECOMB.name().equalsIgnoreCase(service.getMicroServiceFramework())) {
      configurator.setLibrary(service.getProgrammingModel());
    }

    configurator.setApiPackage(
        Optional.ofNullable(service.getApiPackage()).orElse(String.format("%s.api", service.getPackageName())));
    configurator.setModelPackage(
        Optional.ofNullable(service.getModelPackage()).orElse(String.format("%s.model", service.getPackageName())));
  }