• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ArtifactCollector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.maven.artifact.resolver.ArtifactCollector的典型用法代码示例。如果您正苦于以下问题:Java ArtifactCollector类的具体用法?Java ArtifactCollector怎么用?Java ArtifactCollector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ArtifactCollector类属于org.apache.maven.artifact.resolver包,在下文中一共展示了ArtifactCollector类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createDependencyTree

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
private static DependencyNode createDependencyTree(MavenProject project,
        DependencyTreeBuilder dependencyTreeBuilder, ArtifactRepository localRepository,
        ArtifactFactory artifactFactory, ArtifactMetadataSource artifactMetadataSource,
        ArtifactCollector artifactCollector,
        String scope) {
    ArtifactFilter artifactFilter = createResolvingArtifactFilter(scope);

    try {
        // TODO: note that filter does not get applied due to MNG-3236
        return dependencyTreeBuilder.buildDependencyTree(project,
                localRepository, artifactFactory,
                artifactMetadataSource, artifactFilter, artifactCollector);
    } catch (DependencyTreeBuilderException exception) {
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:DependencyTreeFactory.java


示例2: MavenEnvironment

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
public MavenEnvironment(MavenSession aMavenSession, BuildPluginManager aBuildPluginManager, Log aLog,
        DependencyTreeBuilder aDependencyTreeBuilder, ArtifactRepository aLocalRepository,
        SecDispatcher aSecurityDispatcher, MavenProjectBuilder aProjectBuilder,
        LifecycleExecutor aLifecycleExecutor, ArtifactFactory aArtifactFactory,
        ArtifactMetadataSource aArtifactMetadataSource, ArtifactCollector aArtifactCollector, RuntimeInformation aRuntimeInformation,
        MojoExecution aExecution) {
    mavenSession = aMavenSession;
    buildPluginManager = aBuildPluginManager;
    log = aLog;
    dependencyTreeBuilder = aDependencyTreeBuilder;
    localRepository = aLocalRepository;
    securityDispatcher = aSecurityDispatcher;
    projectBuilder = aProjectBuilder;
    lifecycleExecutor = aLifecycleExecutor;
    artifactFactory = aArtifactFactory;
    artifactMetadataSource = aArtifactMetadataSource;
    artifactCollector = aArtifactCollector;
    runtimeInformation = aRuntimeInformation;
    mojoExecution = aExecution;
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:21,代码来源:MavenEnvironment.java


示例3: initialize

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
public static void initialize(MavenSession aMavenSession, BuildPluginManager aBuildPluginManager, Log aLog,
        DependencyTreeBuilder aDependencyTreeBuilder, ArtifactRepository aLocalRepository,
        SecDispatcher aSecurityDispatcher, MavenProjectBuilder aProjectBuilder,
        LifecycleExecutor aLifecycleExecutor, ArtifactFactory aArtifactFactory,
        ArtifactMetadataSource aArtifactMetadataSource, ArtifactCollector aArtifactCollector, RuntimeInformation aRuntimeInformation, MojoExecution aExecution) {
    ENVIRONMENT.set(new MavenEnvironment(aMavenSession, aBuildPluginManager, aLog,
            aDependencyTreeBuilder, aLocalRepository,
            aSecurityDispatcher, aProjectBuilder,
            aLifecycleExecutor, aArtifactFactory,
            aArtifactMetadataSource, aArtifactCollector, aRuntimeInformation, aExecution));
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:12,代码来源:MavenEnvironment.java


示例4: getArtifactCollector

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
/**
 * @return Returns the artifactCollector.
 */
public ArtifactCollector getArtifactCollector ()
{
    return this.artifactCollector;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:8,代码来源:AbstractDependencyMojo.java


示例5: setArtifactCollector

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
/**
 * @param theArtifactCollector The artifactCollector to
 *            set.
 */
public void setArtifactCollector ( ArtifactCollector theArtifactCollector )
{
    this.artifactCollector = theArtifactCollector;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:9,代码来源:AbstractDependencyMojo.java


示例6: getArtifactCollector

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
public ArtifactCollector getArtifactCollector() {
    return artifactCollector;
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:4,代码来源:MavenEnvironment.java


示例7: testInitialize

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
@Test
public void testInitialize() {
    assertNull(MavenEnvironment.get());

    MavenSession aMavenSession = mock(MavenSession.class);
    BuildPluginManager aBuildPluginManager = mock(BuildPluginManager.class);
    Log aLog = mock(Log.class);
    DependencyTreeBuilder aDependencyTreeBuilder = mock(DependencyTreeBuilder.class);
    ArtifactRepository aLocalRepository = mock(ArtifactRepository.class);
    SecDispatcher aSecurityDispatcher = mock(SecDispatcher.class);
    MavenProjectBuilder aProjectBuilder = mock(MavenProjectBuilder.class);
    LifecycleExecutor aLifecycleExecutor = mock(LifecycleExecutor.class);
    ArtifactFactory aArtifactFactory = mock(ArtifactFactory.class);
    ArtifactMetadataSource aArtifactMetadataSource = mock(ArtifactMetadataSource.class);
    ArtifactCollector aArtifactCollector = mock(ArtifactCollector.class);
    RuntimeInformation aRuntimeInformation = mock(RuntimeInformation.class);
    MojoExecution theExecution = mock(MojoExecution.class);

    MavenEnvironment.initialize(aMavenSession, aBuildPluginManager, aLog,
            aDependencyTreeBuilder, aLocalRepository,
            aSecurityDispatcher, aProjectBuilder,
            aLifecycleExecutor, aArtifactFactory,
            aArtifactMetadataSource, aArtifactCollector, aRuntimeInformation, theExecution);

    MavenEnvironment theMavenEnvironment = MavenEnvironment.get();
    assertNotNull(theMavenEnvironment);

    assertSame(aMavenSession, theMavenEnvironment.getMavenSession());
    assertSame(aBuildPluginManager, theMavenEnvironment.getBuildPluginManager());
    assertSame(aLog, theMavenEnvironment.getLog());
    assertSame(aDependencyTreeBuilder, theMavenEnvironment.getDependencyTreeBuilder());
    assertSame(aLocalRepository, theMavenEnvironment.getLocalRepository());
    assertSame(aSecurityDispatcher, theMavenEnvironment.getSecurityDispatcher());
    assertSame(aProjectBuilder, theMavenEnvironment.getProjectBuilder());
    assertSame(aLifecycleExecutor, theMavenEnvironment.getLifecycleExecutor());
    assertSame(aArtifactFactory, theMavenEnvironment.getArtifactFactory());
    assertSame(aArtifactMetadataSource, theMavenEnvironment.getArtifactMetadataSource());
    assertSame(aArtifactCollector, theMavenEnvironment.getArtifactCollector());
    assertSame(aRuntimeInformation, theMavenEnvironment.getRuntimeInformation());

    MavenEnvironment.cleanUp();;
    assertNull(MavenEnvironment.get());
}
 
开发者ID:mirkosertic,项目名称:mavensonarsputnik,代码行数:44,代码来源:MavenEnvironmentTest.java


示例8: resolveExecutionClasspath

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
/**
 * Resolves the processing unit's dependencies classpath.
 * 
 * @param project the processing unit project
 * @param includeScopes the scopes of the dependencies to include
 * @param includeProjects whether to include project's output directories
 * @param reactorProjects the reactor projects
 * @param dependencyTreeBuilder the dependency tree builder
 * @param metadataSource the metadata source
 * @param artifactCollector the artifact collector
 * @param artifactResolver the artifact resolver
 * @param artifactFactory the artifact factory
 * @param localRepository the local repository
 * @param remoteRepositories the remote repositories
 * @return a list containing all dependency URLs.
 * @throws Exception
 */
static List resolveExecutionClasspath(MavenProject project, String[] includeScopes, 
        boolean includeProjects, List reactorProjects, DependencyTreeBuilder dependencyTreeBuilder, 
        ArtifactMetadataSource metadataSource, ArtifactCollector artifactCollector, 
        ArtifactResolver artifactResolver, ArtifactFactory artifactFactory, 
        ArtifactRepository localRepository, List remoteRepositories) throws Exception {
    
    Set scopes = new HashSet(includeScopes.length);
    Collections.addAll(scopes, includeScopes);
    
    // resolve all dependency of the specifies scope
    // scope 'test' is the widest scope available.
    ArtifactFilter artifactFilter = new ScopeArtifactFilter("test");
    DependencyNode root = dependencyTreeBuilder.buildDependencyTree(project, localRepository, artifactFactory,
                                                     metadataSource, artifactFilter,artifactCollector);
    
    // resolve all dependency files. if the dependency is a referenced project and not
    // a file in the repository add its output directory to the classpath. 
    Iterator i = root.preorderIterator();
    Set artifacts = new HashSet();
    while (i.hasNext()) {
        DependencyNode node = (DependencyNode)i.next();
        // the dependency may not be included due to duplication
        // dependency cycles and version conflict.
        // don't include those in the classpath.
        if (node.getState() != DependencyNode.INCLUDED) {
            PluginLog.getLog().debug("Not including dependency: " + node);
            continue;
        }
        Artifact artifact = node.getArtifact();
        if (artifact.getFile() == null) {
            try {
                // if file is not found an exception is thrown
                artifactResolver.resolve(artifact, remoteRepositories, localRepository);
            }
            catch (Exception e) {
                if (includeProjects) {
                    // try to see if the dependency is a referenced project
                    Iterator projectsIterator = reactorProjects.iterator();
                    while (projectsIterator.hasNext()) {
                        MavenProject proj = (MavenProject)projectsIterator.next();
                        if (proj.getArtifactId().equals(artifact.getArtifactId())) {
                            artifact.setFile(new File(proj.getBuild().getOutputDirectory()));
                            break;
                        }
                    }
                }
            }
        }
        if (!scopes.contains(artifact.getScope())) {
            if (artifact.getScope() != null) {
                continue;
            }
            // if it's not the same project don't add 
            if (!includeProjects || !project.getArtifactId().equals(artifact.getArtifactId())) {
                continue;
            }
        }
        artifacts.add(artifact);
    }
    
    return getArtifactURLs(artifacts);
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:80,代码来源:Utils.java


示例9: getArtifactCollector

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
public ArtifactCollector getArtifactCollector() {
	return artifactCollector;
}
 
开发者ID:panthers,项目名称:panthers-maven-jungle,代码行数:4,代码来源:AbstractDependencyMojo.java


示例10: setArtifactCollector

import org.apache.maven.artifact.resolver.ArtifactCollector; //导入依赖的package包/类
public void setArtifactCollector(ArtifactCollector artifactCollector) {
	this.artifactCollector = artifactCollector;
}
 
开发者ID:panthers,项目名称:panthers-maven-jungle,代码行数:4,代码来源:AbstractDependencyMojo.java



注:本文中的org.apache.maven.artifact.resolver.ArtifactCollector类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AssocChangeEvent类代码示例发布时间:2022-05-21
下一篇:
Java ErrorCorrection类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap