All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.jhipster.lite.module.infrastructure.secondary.javadependency.FileSystemMavenDependenciesReader Maven / Gradle / Ivy

There is a newer version: 1.23.0
Show newest version
package tech.jhipster.lite.module.infrastructure.secondary.javadependency;

import java.util.List;
import java.util.regex.Pattern;
import tech.jhipster.lite.module.domain.ProjectFiles;
import tech.jhipster.lite.module.domain.javadependency.JavaDependenciesVersions;
import tech.jhipster.lite.module.domain.javadependency.JavaDependencyVersion;

public class FileSystemMavenDependenciesReader implements JavaDependenciesReader {

  private static final Pattern VERSIONS_PATTERN = Pattern.compile("<([^>]+)\\.version>([^>]+) versions = readVersions(files.readString(currentVersionsFile));

    return new JavaDependenciesVersions(versions);
  }

  private List readVersions(String content) {
    return VERSIONS_PATTERN.matcher(content).results().map(result -> new JavaDependencyVersion(result.group(1), result.group(2))).toList();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy