com.github.danielflower.mavenplugins.release.MavenVersionResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multi-module-maven-release-plugin Show documentation
Show all versions of multi-module-maven-release-plugin Show documentation
A maven release plugin built for multi-maven-module git repositories allowing continuous deployment
The newest version!
package com.github.danielflower.mavenplugins.release;
import java.util.List;
import java.util.Properties;
import org.apache.maven.project.MavenProject;
class MavenVersionResolver {
static void resolveVersionsDefinedThroughProperties(List projects) {
for (MavenProject project : projects) {
if (isVersionDefinedWithProperty(project.getVersion())) {
project.setVersion(resolveVersion(project.getVersion(), project.getProperties()));
}
}
}
static String resolveVersion(String version, Properties projectProperties) {
if (isVersionDefinedWithProperty(version)) {
return projectProperties.getProperty(version.replace("${", "").replace("}", ""), version);
}
return version;
}
static boolean isSnapshot(String version) {
return (version != null && version.endsWith("-SNAPSHOT"));
}
private static boolean isVersionDefinedWithProperty(String version) {
return version != null && version.startsWith("${");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy