@NotNull
  public static Model toNativeModel(MavenModel model) {
    Model result = new Model();
    result.setArtifactId(model.getMavenId().getArtifactId());
    result.setGroupId(model.getMavenId().getGroupId());
    result.setVersion(model.getMavenId().getVersion());
    result.setPackaging(model.getPackaging());
    result.setName(model.getName());

    if (model.getParent() != null) {
      Parent parent = new Parent();
      parent.setArtifactId(model.getParent().getMavenId().getArtifactId());
      parent.setGroupId(model.getParent().getMavenId().getGroupId());
      parent.setVersion(model.getParent().getMavenId().getVersion());
      parent.setRelativePath(model.getParent().getRelativePath());
      result.setParent(parent);
    }
    toNativeModelBase(model, result);

    result.setBuild(new Build());
    MavenBuild modelBuild = model.getBuild();
    toNativeBuildBase(modelBuild, result.getBuild());
    result.getBuild().setOutputDirectory(modelBuild.getOutputDirectory());
    result.getBuild().setTestOutputDirectory(modelBuild.getTestOutputDirectory());

    if (modelBuild.getSources().size() > 1) throw new RuntimeException("too many source directories: " + modelBuild.getSources());
    if (modelBuild.getTestSources().size() > 1) throw new RuntimeException("too many test directories: " + modelBuild.getTestSources());

    if (modelBuild.getSources().size() == 1) {
      result.getBuild().setSourceDirectory(modelBuild.getSources().get(0));
    }
    if (modelBuild.getTestSources().size() == 1) {
      result.getBuild().setTestSourceDirectory(modelBuild.getTestSources().get(0));
    }

    result.setProfiles(toNativeProfiles(model.getProfiles()));

    return result;
  }
@NotNull
  public static Model toNativeModel(MavenModel model)