當前位置: 首頁>>代碼示例>>Java>>正文


Java MavenProject.getDependencyManagement方法代碼示例

本文整理匯總了Java中org.apache.maven.project.MavenProject.getDependencyManagement方法的典型用法代碼示例。如果您正苦於以下問題:Java MavenProject.getDependencyManagement方法的具體用法?Java MavenProject.getDependencyManagement怎麽用?Java MavenProject.getDependencyManagement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.project.MavenProject的用法示例。


在下文中一共展示了MavenProject.getDependencyManagement方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: managedAsArtifacts

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
public Set<Artifact> managedAsArtifacts(ProjectBuildingRequest projectBuildingRequest, MavenProject project) throws MavenExecutionException {
	if (project.getDependencyManagement() != null) {
		return asArtifacts(projectBuildingRequest, project.getDependencyManagement().getDependencies());
	} else {
		return Collections.emptySet();
	}
}
 
開發者ID:commsen,項目名稱:EM,代碼行數:8,代碼來源:Dependencies.java

示例2: getDependenciesFromDM

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
private static List<Dependency> getDependenciesFromDM(MavenProject project, Project nbprj) {
    NbMavenProjectImpl p = nbprj.getLookup().lookup(NbMavenProjectImpl.class);
    MavenProject localProj = project;
    DependencyManagement curDM;
    List<Dependency> result = new ArrayList<Dependency>();
    //mkleint: without the managementKey checks I got some entries multiple times.
    // do we actually need to traverse the parent poms, are they completely resolved anyway?
    //XXX
    Set<String> knownKeys = new HashSet<String>();

    while (localProj != null) {
        curDM = localProj.getDependencyManagement();
        if (curDM != null) {
            @SuppressWarnings("unchecked")
            List<Dependency> ds = curDM.getDependencies();
            for (Dependency d : ds) {
                if (knownKeys.contains(d.getManagementKey())) {
                    continue;
                }
                result.add(d);
                knownKeys.add(d.getManagementKey());
            }
        }
        try {
            localProj = p.loadParentOf(EmbedderFactory.getProjectEmbedder(), localProj);
        } catch (ProjectBuildingException x) {
            break;
        }
    }
    Collections.sort(result, new Comparator<Dependency>() {

        @Override
        public int compare(Dependency o1, Dependency o2) {
            return o1.getManagementKey().compareTo(o2.getManagementKey());
        }
    });
    return result;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:39,代碼來源:AddDependencyPanel.java

示例3: hasEffectiveDependency

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
private boolean hasEffectiveDependency(String groupId, String artifactId, NbMavenProject prj) {
    MavenProject mp = prj.getMavenProject();
    List<org.apache.maven.model.Dependency> dl = new ArrayList<org.apache.maven.model.Dependency>();
    dl.addAll(mp.getDependencies());
    org.apache.maven.model.DependencyManagement dm = mp.getDependencyManagement();
    if (dm != null) {
        dl.addAll(dm.getDependencies());
    }
    for (org.apache.maven.model.Dependency d : dl) {
        if (groupId.equals(d.getGroupId()) && artifactId.equals(d.getArtifactId())) {
            return true;
        }
    }
    return false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:MavenTestNGSupport.java


注:本文中的org.apache.maven.project.MavenProject.getDependencyManagement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。