当前位置: 首页>>代码示例>>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;未经允许,请勿转载。