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


Java MavenProject.getCompileArtifacts方法代碼示例

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


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

示例1: createCompileCPI

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
private ClassPathImplementation createCompileCPI(MavenProject project, File binary) {
    List<PathResourceImplementation> items = new ArrayList<PathResourceImplementation>();
    //according to jglick this could be posisble to leave out on compilation CP..
    items.add(ClassPathSupport.createResource(FileUtil.urlForArchiveOrDir(binary)));
    if (project != null) {
        for (Artifact s : project.getCompileArtifacts()) {
            File file = s.getFile();
            if (file == null) continue;
            URL u = FileUtil.urlForArchiveOrDir(file);
            if(u != null) {
                items.add(ClassPathSupport.createResource(u));
            } else {
                LOG.log(Level.FINE, "Could not retrieve URL for artifact file {0}", new Object[] {file}); // NOI18N
            }
        }
    }
    return ClassPathSupport.createClassPathImplementation(items);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:RepositoryMavenCPProvider.java

示例2: getCompileArtifacts

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
static boolean getCompileArtifacts(MavenProject mavenProject, List<URI> lst) {
    // according the current 2.1 sources this is almost the same as getCompileClasspath()
    //except for the fact that multiproject references are not redirected to their respective
    // output folders.. we lways retrieve stuff from local repo..
    List<Artifact> arts = mavenProject.getCompileArtifacts();
    boolean broken = false;
    for (Artifact art : arts) {
        if (art.getFile() != null) {
            lst.add(Utilities.toURI(art.getFile()));
            broken |= !art.getFile().exists();
        } else {
            //NOPMD   //null means dependencies were not resolved..
            broken = true;
        } 
    }
    return broken;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:CompileClassPathImpl.java

示例3: getArtifact

import org.apache.maven.project.MavenProject; //導入方法依賴的package包/類
private Artifact getArtifact(NbMavenProject mavProj, List<NBVersionInfo> nbvis, boolean isTestSource) {
    MavenProject mp = mavProj.getMavenProject();
    List<Artifact> arts = new LinkedList<Artifact>(isTestSource ? mp.getTestArtifacts() : mp.getCompileArtifacts());
    for (NBVersionInfo info : nbvis) {
        for (Artifact a : arts) {
            if (a.getGroupId() != null && a.getGroupId().equals(info.getGroupId())) {
                if (a.getArtifactId() != null && a.getArtifactId().equals(info.getArtifactId())) {
                    String scope = a.getScope();
                    if ("compile".equals(scope) || "test".equals(scope)) { // NOI18N
                        return a;
                    }
                }
            }
        }
    }
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:SearchClassDependencyInRepo.java


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