Class EnforcerRuleUtils


  • public class EnforcerRuleUtils
    extends Object
    The Class EnforcerRuleUtils.
    Author:
    Brian Fox
    • Constructor Detail

      • EnforcerRuleUtils

        public EnforcerRuleUtils​(EnforcerRuleHelper helper)
        Instantiates a new enforcer rule utils.
        Parameters:
        helper - the helper
    • Method Detail

      • getModelsRecursively

        public List<org.apache.maven.model.Model> getModelsRecursively​(String groupId,
                                                                       String artifactId,
                                                                       String version,
                                                                       File pom)
                                                                throws org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException,
                                                                       IOException,
                                                                       org.codehaus.plexus.util.xml.pull.XmlPullParserException
        This method loops through all the parents, getting each pom model and then its parent.
        Parameters:
        groupId - the group id
        artifactId - the artifact id
        version - the version
        pom - the pom
        Returns:
        the models recursively
        Throws:
        org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException - the artifact resolution exception
        IOException - Signals that an I/O exception has occurred.
        org.codehaus.plexus.util.xml.pull.XmlPullParserException - the xml pull parser exception
      • checkIfModelMatches

        protected boolean checkIfModelMatches​(String groupId,
                                              String artifactId,
                                              String version,
                                              org.apache.maven.model.Model model)
        Make sure the model is the one I'm expecting.
        Parameters:
        groupId - the group id
        artifactId - the artifact id
        version - the version
        model - Model being checked.
        Returns:
        true, if check if model matches
      • resolvePlugins

        public List<org.apache.maven.model.Plugin> resolvePlugins​(List<org.apache.maven.model.Plugin> plugins)
      • resolveReportPlugins

        public List<org.apache.maven.model.ReportPlugin> resolveReportPlugins​(List<org.apache.maven.model.ReportPlugin> reportPlugins)