private int executeCommand(CommandLine commandLine, String scriptName, String env) {
    @SuppressWarnings("hiding")
    GrailsConsole console = GrailsConsole.getInstance();
    // Load the BuildSettings file for this project if it exists. Note
    // that this does not load any environment-specific settings.
    try {
      System.setProperty("disable.grails.plugin.transform", "true");

      console.updateStatus("Loading Grails " + settings.getGrailsVersion());
      settings.loadConfig();

      System.setProperty(
          "springloaded.directoriesContainingReloadableCode",
          settings.getClassesDir().getAbsolutePath()
              + ','
              + settings.getPluginClassesDir().getAbsolutePath());
    } catch (Exception e) {
      console.error("There was an error loading the BuildConfig: " + e.getMessage(), e);
      System.exit(1);
    } finally {
      System.setProperty("disable.grails.plugin.transform", "false");
    }

    // Add some extra binding variables that are now available.
    // settings.setGrailsEnv(env);
    // settings.setDefaultEnv(useDefaultEnv);

    BuildSettingsHolder.setSettings(settings);

    return callPluginOrGrailsScript(commandLine, scriptName, env);
  }