private void checkMavenWrapperAndPatchJavaParams() {
      if (myConfiguration.getGeneralSettings() == null || !MavenUtil.isWrapper(myConfiguration.getGeneralSettings())) return;

      MavenDistributionsCache instance = MavenDistributionsCache.getInstance(myConfiguration.getProject());
      String workingDirPath = myConfiguration.getRunnerParameters().getWorkingDirPath();
      MavenDistribution wrapper = instance.getWrapper(workingDirPath);
      if (wrapper == null) {
        MavenWrapperDownloader.checkOrInstall(myConfiguration.getProject(), workingDirPath);
      }
      wrapper = instance.getWrapper(workingDirPath);
      if (wrapper == null) return;
      try {
        JavaParameters javaParameters = getJavaParameters();
        if (javaParameters == null || !javaParameters.getVMParametersList().hasProperty(MavenConstants.HOME_PROPERTY)) return;
        String mavenHomePath = wrapper.getMavenHome().toFile().getCanonicalPath();

        ParametersList vmParametersList = javaParameters.getVMParametersList();
        if (Objects.equals(vmParametersList.getPropertyValue(MavenConstants.HOME_PROPERTY), wrapper.getMavenHome().toString())) return;
        vmParametersList.addProperty(MavenConstants.HOME_PROPERTY, mavenHomePath);
      }
      catch (IOException | ExecutionException e) {
        MavenLog.LOG.error(e);
      }
    }
private void checkMavenWrapperAndPatchJavaParams()