org.apache.maven.plugins.enforcer.utils
Class EnforcerRuleUtils

java.lang.Object
  extended by org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtils

public class EnforcerRuleUtils
extends Object

The Class EnforcerRuleUtils.

Author:
Brian Fox

Constructor Summary
EnforcerRuleUtils(ArtifactFactory theFactory, ArtifactResolver theResolver, ArtifactRepository theLocal, List<ArtifactRepository> theRemoteRepositories, MavenProject project, Log theLog)
          Instantiates a new enforcer rule utils.
EnforcerRuleUtils(EnforcerRuleHelper helper)
          Instantiates a new enforcer rule utils.
 
Method Summary
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.
 List<org.apache.maven.model.Model> getModelsRecursively(String groupId, String artifactId, String version, File pom)
          This method loops through all the parents, getting each pom model and then its parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnforcerRuleUtils

public EnforcerRuleUtils(ArtifactFactory theFactory,
                         ArtifactResolver theResolver,
                         ArtifactRepository theLocal,
                         List<ArtifactRepository> theRemoteRepositories,
                         MavenProject project,
                         Log theLog)
Instantiates a new enforcer rule utils.

Parameters:
theFactory - the the factory
theResolver - the the resolver
theLocal - the the local
theRemoteRepositories - the the remote repositories
project - the project
theLog - the the log

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 ArtifactResolutionException,
                                                               ArtifactNotFoundException,
                                                               IOException,
                                                               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:
ArtifactResolutionException - the artifact resolution exception
ArtifactNotFoundException - the artifact not found exception
IOException - Signals that an I/O exception has occurred.
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


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.