private static Properties getFilteringProperties(MavenProject mavenProject,
                                                   MavenProjectsManager mavenProjectsManager) {
    final Properties properties = new Properties();

    for (String each : mavenProject.getFilterPropertiesFiles()) {
      try (FileInputStream in = new FileInputStream(each)) {
        properties.load(in);
      }
      catch (IOException ignored) {
      }
    }

    properties.putAll(mavenProject.getProperties());

    properties.setProperty("settings.localRepository", mavenProject.getLocalRepository().getAbsolutePath());

    String jreDir = MavenUtil.getModuleJreHome(mavenProjectsManager, mavenProject);
    if (jreDir != null) {
      properties.setProperty("java.home", jreDir);
    }

    String javaVersion = MavenUtil.getModuleJavaVersion(mavenProjectsManager, mavenProject);
    if (javaVersion != null) {
      properties.setProperty("java.version", javaVersion);
    }

    return properties;
  }
private static Properties getFilteringProperties(MavenProject mavenProject,
                                                   MavenProjectsManager mavenProjectsManager)