use of com.qoomon.maven.extension.gitversioning.config.model.Configuration in project maven-git-versioning-extension by qoomon.
the class VersioningConfigurationProvider method get.
public VersioningConfiguration get() {
if (configuration == null) {
MavenSession session = SessionScopeUtil.get(sessionScope, MavenSession.class).get();
List<VersionFormatDescription> branchVersionDescriptions = new LinkedList<>();
List<VersionFormatDescription> tagVersionDescriptions = new LinkedList<>();
File configFile = ExtensionUtil.getConfigFile(session.getRequest(), BuildProperties.projectArtifactId());
if (configFile.exists()) {
Configuration configurationModel = loadConfiguration(configFile);
branchVersionDescriptions.addAll(configurationModel.branches);
tagVersionDescriptions.addAll(configurationModel.tags);
} else {
logger.info("No configuration file found. Apply default configuration.");
}
branchVersionDescriptions.add(DEFAULT_BRANCH_VERSION_DESCRIPTION);
configuration = new VersioningConfiguration(branchVersionDescriptions, tagVersionDescriptions);
}
return configuration;
}
Aggregations