code: public void repackage(File destination, Libraries libraries,
                            LaunchScript launchScript) throws IOException {
          if (destination == null || destination.isDirectory()) {
              throw new IllegalArgumentException("Invalid destination");
          }
          if (libraries == null) {
              throw new IllegalArgumentException("Libraries must not be null");
          }
          if (alreadyRepackaged()) {
              return;
          }
          destination = destination.getAbsoluteFile();
          File workingSource = this.source;
          if (this.source.equals(destination)) {
              workingSource = new File(this.source.getParentFile(),
                      this.source.getName() + ".original");
              workingSource.delete();
              renameFile(this.source, workingSource);
          }
          destination.delete();
          try {
              JarFile jarFileSource = new JarFile(workingSource);
              try {
                  repackage(jarFileSource, destination, libraries, launchScript);
              } finally {
                  jarFileSource.close();
              }
          } finally {
              if (!this.backupSource && !this.source.equals(workingSource)) {
                  deleteFile(workingSource);
              }
          }
      }
docs: Repackage to the given destination so that it can be launched using '
  {@literal java -jar}'.
  
  @param destination  the destination file (may be the same as the source)
  @param libraries    the libraries required to run the archive
  @param launchScript an optional launch script prepended to the front of the jar
  @throws IOException if the file cannot be repackaged
  @since 1.3.0