Class AbstractStandardEnforcerRule

All Implemented Interfaces:
EnforcerRuleBase
Direct Known Subclasses:
AbstractPropertyEnforcerRule, AbstractRequireFiles, AbstractVersionEnforcer, AlwaysFail, AlwaysPass, BanDependencyManagementScope, BanDistributionManagement, BanDuplicatePomDependencyVersions, BanDynamicVersions, BannedDependenciesBase, BannedPlugins, BannedRepositories, BanTransitiveDependencies, DependencyConvergence, EvaluateBeanshell, ReactorModuleConvergence, RequireActiveProfile, RequireExplicitDependencyScope, RequireFileChecksum, RequireJavaVendor, RequireNoRepositories, RequireOS, RequirePluginVersions, RequirePrerequisite, RequireProfileIdsExist, RequireReleaseVersion, RequireSameVersions, RequireSnapshotVersion, RequireUpperBoundDeps

public abstract class AbstractStandardEnforcerRule extends AbstractEnforcerRule
Abstract help rule.
Since:
3.2.0
  • Field Details

    • message

      private String message
  • Constructor Details

    • AbstractStandardEnforcerRule

      public AbstractStandardEnforcerRule()
  • Method Details

    • getMessage

      public String getMessage()
    • setMessage

      public void setMessage(String message)
    • getProjectId

      private static String getProjectId(org.apache.maven.project.MavenProject project)
      Returns an identifier of a given project.
      Parameters:
      project - the project
      Returns:
      the identifier of the project in the format <groupId>:<artifactId>:<version>
    • formatLocation

      protected static String formatLocation(org.apache.maven.project.MavenProject project, org.apache.maven.model.InputLocation location)
      Creates a string with line/column information for problems originating directly from this POM. Inspired by o.a.m.model.building.ModelProblemUtils.formatLocation(...).
      Parameters:
      project - the current project.
      location - The location which should be formatted, must not be null.
      Returns:
      The formatted problem location or an empty string if unknown, never null.