Get root node of the current Maven project Dependency tree generated by
maven.shared dependency graph builder.

@return root node of the project Dependency tree
@throws MojoExecutionException
509817
protected DependencyNode getRootNodeDependecyTree() throws MojoExecutionException{
    try {
      ArtifactFilter artifactFilter = null;

      // works for only maven 3. Use of dependency graph component not handled for maven 2
      // as current version of NAR already requires Maven 3.x
      rootNode = dependencyGraphBuilder.buildDependencyGraph(getMavenProject(), artifactFilter);

    } catch (DependencyGraphBuilderException exception) {
      throw new MojoExecutionException("Cannot build project dependency graph", exception);
    }

    return rootNode;
  }
222831
private String getRelativePomPath(MavenModule mavenModule, MavenModuleSetBuild mavenBuild) {
        String relativePath = mavenModule.getRelativePath();
        if (StringUtils.isBlank(relativePath)) {
            return POM_NAME;
        }

        // If this is the root module, return the root pom path.
        if (mavenModule.getModuleName().toString().
                equals(mavenBuild.getProject().getRootModule().getModuleName().toString())) {
            return mavenBuild.getProject().getRootPOM(null);
        }

        // to remove the project folder name if exists
        // keeps only the name of the module
        String modulePath = relativePath.substring(relativePath.indexOf("/") + 1);
        for (String moduleName : mavenModules) {
            if (moduleName.contains(modulePath)) {
                return createPomPath(relativePath, moduleName);
            }
        }

        // In case this module is not in the parent pom
        return relativePath + "/" + POM_NAME;
    }
1312760
public function getProjectRoot()
    {
        // Backwards compatibility - if in an old-style project root, change
        // directory to the repository.
        if (is_dir('repository') && file_exists($this->config->get('local.project_config_legacy'))) {
            $cwd = getcwd();
            chdir('repository');
        }

        // The project root is a Git repository, which contains a project
        // configuration file, and/or contains a Git remote with the appropriate
        // domain.
        $dir = $this->findTopDirectoryContaining('.git', function ($dir) {
            $config = $this->getProjectConfig($dir);

            return !empty($config);
        });

        if (isset($cwd)) {
            chdir($cwd);
        }

        return $dir;
    }
860660
private String getOutputName() throws MojoExecutionException
    {
        if ( MSBuildPackaging.isSolution( mavenProject.getPackaging() ) )
        {
            throw new MojoExecutionException( "Internal error: Cannot determine single output name for a solutions" );
        }
        String projectFileName = projectFile.getName();
        if ( ! projectFileName.contains( "." ) )
        {
            throw new MojoExecutionException( "Project file name has no extension, please check your configuration" );
        }
        projectFileName = projectFileName.substring( 0, projectFileName.lastIndexOf( '.' ) );
        return projectFileName;
    }
117078
public ManagementModelNode getSelectedNode() {
        if (tree.getSelectionPath() == null) return null;
        return (ManagementModelNode)tree.getSelectionPath().getLastPathComponent();
    }
763702
private ViewNode getRootViewNode(HttpServletRequest request) throws Exception {
    String rooNodeID = getRootNodeID(request);
    if (rooNodeID == null){
      Debug.logError("[JdonFramework] root Id is null ! " , module);
      return null;
    }
    Debug.logVerbose("[JdonFramework] get the tree's root Node: " + rooNodeID, module);
    ViewNode rNode = new ViewNode(rooNodeID, rooNodeID, true);
    rNode.setRoot(true);
    return rNode;
  }
947541
public @Nonnull Object getRoot() {
    Chain current = this;
    while (current.hasParent()) {
      current = current.getParent();
    }
    return current.getValue();
  }
300033
@Override
    public String getContextRoot() {
        if (delegate == null) {
            return this.contextRoot;
        } else {
            return this.contextRoot == null ? delegate.getContextRoot() : this.contextRoot;
        }
    }
372049
public MavenProject getMavenProject(Artifact artifact) {
		try {
			final MavenSession session = getMavenSession();
			final MavenProject current = session.getCurrentProject();
			final MavenProject prj = getMavenProjectBuilder().buildFromRepository(
					artifact,
					current.getRemoteArtifactRepositories(),
					session.getLocalRepository());
			return prj;
		} catch (ProjectBuildingException e) {
			getLog().warn(e);
		}
		return null;
	}
781038
protected CmsObject getRootCmsObject() {

        if (m_rootCms == null) {

            m_rootCms = getOfflineCmsObject(A_CmsUI.getCmsObject());
            m_rootCms.getRequestContext().setSiteRoot("");

        }
        return m_rootCms;
    }
531267
@Nullable
  private File findProjectGitDirectory() {
    if (this.mavenProject == null) {
      return null;
    }

    File basedir = mavenProject.getBasedir();
    while (basedir != null) {
      File gitdir = new File(basedir, Constants.DOT_GIT);
      if (gitdir.exists()) {
        if (gitdir.isDirectory()) {
          return gitdir;
        } else if (gitdir.isFile()) {
          return processGitDirFile(gitdir);
        } else {
          return null;
        }
      }
      basedir = basedir.getParentFile();
    }
    return null;
  }
89932
private void buildDependencyTree()
        throws DependencyTreeBuilderException
    {
        if ( rootNode == null )
        {
            rootNode =
                dependencyTreeBuilder.buildDependencyTree( project, localRepository, artifactFactory,
                                                           artifactMetadataSource, null, artifactCollector );
        }
    }
1005559
public synchronized Node masterNode() {
        final ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();
        final String name = state.nodes().getMasterNode().getName();
        return getNode(name);
    }
273306
protected Resolver getResolver()
        throws MojoExecutionException
    {
        List<File> catalogFiles = new ArrayList<File>();
        List<URL> catalogUrls = new ArrayList<URL>();
        setCatalogs( catalogFiles, catalogUrls );

        return new Resolver( getBasedir(), catalogFiles, catalogUrls, getLocator(), catalogHandling,getLog().isDebugEnabled() );
    }
1240056
public Node parentNode() {

		if (currentNode == null)
			return null;

		Node node = getParentNode(currentNode);

		if (node != null)
			currentNode = node;

		return node;

	}
769056
public function getRoot()
    {
        if (!$this->root) {
            $this->root = $this->active->getContext()->getCurrentSiteNode();
        }

        return $this->root;
    }
574663
public java.lang.String getRootElement() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.rootElement);

    }