code: protected boolean compareDependency( String[] pattern, Artifact artifact )
          throws EnforcerRuleException
      {
  
          boolean result = false;
          if ( pattern.length > 0 )
          {
              result = pattern[0].equals( "*" ) || artifact.getGroupId().equals( pattern[0] );
          }
  
          if ( result && pattern.length > 1 )
          {
              result = pattern[1].equals( "*" ) || artifact.getArtifactId().equals( pattern[1] );
          }
  
          if ( result && pattern.length > 2 )
          {
              // short circuit if the versions are exactly the same
              if ( pattern[2].equals( "*" ) || artifact.getVersion().equals( pattern[2] ) )
              {
                  result = true;
              }
              else
              {
                  try
                  {
                      result =
                          AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( pattern[2] ),
                                                                   new DefaultArtifactVersion( artifact.getBaseVersion() ) );
                  }
                  catch ( InvalidVersionSpecificationException e )
                  {
                      throw new EnforcerRuleException( "Invalid Version Range: ", e );
                  }
              }
          }
  
          if ( result && pattern.length > 3 )
          {
              String type = artifact.getType();
              if ( type == null || type.equals( "" ) )
              {
                  type = "jar";
              }
              result = pattern[3].equals( "*" ) || type.equals( pattern[3] );
          }
  
          if ( result && pattern.length > 4 )
          {
              String scope = artifact.getScope();
              if ( scope == null || scope.equals( "" ) )
              {
                  scope = "compile";
              }
              result = pattern[4].equals( "*" ) || scope.equals( pattern[4] );
          }
  
          return result;
      }
docs: Compares the parsed array of substrings against the artifact.
  The pattern should follow the format "groupId:artifactId:version:type:scope"
  
  @param pattern the array of patterns
  @param artifact the artifact
  @return <code>true</code> if the artifact matches one of the patterns
  @throws EnforcerRuleException the enforcer rule exception