com.lewisd.maven.lint.rules.basic.VersionPropertiesMustUseDotVersionRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lint-maven-plugin Show documentation
Show all versions of lint-maven-plugin Show documentation
Generates a report of suspicious/inconsistent POM elements, and optionally fails the build if violations are found.
The newest version!
package com.lewisd.maven.lint.rules.basic;
import java.util.Map;
import java.util.Set;
import org.apache.maven.model.InputLocation;
import org.apache.maven.project.MavenProject;
import org.springframework.beans.factory.annotation.Autowired;
import com.lewisd.maven.lint.ResultCollector;
import com.lewisd.maven.lint.model.VersionProperty;
import com.lewisd.maven.lint.rules.AbstractRule;
import com.lewisd.maven.lint.util.ExpressionEvaluator;
import com.lewisd.maven.lint.util.ModelUtil;
public class VersionPropertiesMustUseDotVersionRule extends AbstractRule {
@Autowired
public VersionPropertiesMustUseDotVersionRule(final ExpressionEvaluator expressionEvaluator, final ModelUtil modelUtil) {
super(expressionEvaluator, modelUtil);
}
@Override
protected void addRequiredModels(final Set requiredModels) {
requiredModels.add(VERSION_PROPERTIES);
}
@Override
public String getIdentifier() {
return "DotVersionProperty";
}
@Override
public String getDescription() {
return "The convention is to specify properties used to hold versions as some.library.version or some-library.version, " +
"but never some-library-version or some.library-version.";
}
@Override
public void invoke(final MavenProject mavenProject, final Map models, final ResultCollector resultCollector) {
@SuppressWarnings("unchecked")
final Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy