private static void patchConfFile(File originalConf, File dest, String library) throws IOException {

    try (Scanner sc = new Scanner(originalConf);
         BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dest), StandardCharsets.UTF_8))) {
      boolean patched = false;

      while (sc.hasNextLine()) {
        String line = sc.nextLine();

        out.append(line);
        out.newLine();

        if (!patched && "[plexus.core]".equals(line)) {
          out.append("load ").append(library);
          out.newLine();

          patched = true;
        }
      }
    }
  }
private static void patchConfFile(File originalConf, File dest, String library)