* @throws EnforcerRuleException
*/
private DependencyNode getNode(EnforcerRuleHelper helper) throws EnforcerRuleException {
try {
MavenProject project = (MavenProject) helper.evaluate("${project}");
DependencyTreeBuilder dependencyTreeBuilder = (DependencyTreeBuilder) helper.getComponent(DependencyTreeBuilder.class);
ArtifactRepository repository = (ArtifactRepository)helper.evaluate("${localRepository}");
ArtifactFactory factory = (ArtifactFactory)helper.getComponent(ArtifactFactory.class);
ArtifactMetadataSource metadataSource = (ArtifactMetadataSource)helper.getComponent(ArtifactMetadataSource.class);
ArtifactCollector collector = (ArtifactCollector)helper.getComponent(ArtifactCollector.class);
ArtifactFilter filter = null; //we need to evaluate all scopes
DependencyNode node = dependencyTreeBuilder.buildDependencyTree(project, repository, factory, metadataSource, filter, collector);
return node;
} catch (ExpressionEvaluationException e) {
throw new EnforcerRuleException("Unable to lookup an expression " + e.getLocalizedMessage(), e);
} catch (ComponentLookupException e){
throw new EnforcerRuleException("Unable to lookup a component " + e.getLocalizedMessage(), e);