code: protected int getNextVersion(DeploymentEntity deployment, DefinitionEntity newDefinition, DefinitionEntity latestDefinition) {
      int result = 1;
      if (latestDefinition != null) {
        int latestVersion = latestDefinition.getVersion();
        result = latestVersion + 1;
      }
      return result;
    }
docs: per default we increment the latest definition version by one - but you
  might want to hook in some own logic here, e.g. to align definition
  versions with deployment / build versions.