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

Java DefaultArtifactFactory类代码示例

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

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



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

示例1: createHelper

import org.apache.maven.artifact.factory.DefaultArtifactFactory; //导入依赖的package包/类
private DefaultVersionsHelper createHelper( String rulesUri, ArtifactMetadataSource metadataSource )
    throws MojoExecutionException
{
    final DefaultWagonManager wagonManager = new DefaultWagonManager()
    {
        public Wagon getWagon( Repository repository )
            throws UnsupportedProtocolException, WagonConfigurationException
        {
            return new FileWagon();
        }
    };

    DefaultVersionsHelper helper =
        new DefaultVersionsHelper( new DefaultArtifactFactory(), new DefaultArtifactResolver(), metadataSource, new ArrayList(),
                                   new ArrayList(),
                                   new DefaultArtifactRepository( "", "", new DefaultRepositoryLayout() ),
                                   wagonManager, new Settings(), "", rulesUri, mock( Log.class ), mock( MavenSession.class ),
                                   new DefaultPathTranslator());
    return helper;
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:21,代码来源:DefaultVersionsHelperTest.java


示例2: createHelper

import org.apache.maven.artifact.factory.DefaultArtifactFactory; //导入依赖的package包/类
private VersionsHelper createHelper( String rulesUri, ArtifactMetadataSource metadataSource )
    throws MojoExecutionException
{
    final DefaultWagonManager wagonManager = new DefaultWagonManager()
    {
        public Wagon getWagon( Repository repository )
            throws UnsupportedProtocolException, WagonConfigurationException
        {
            return new FileWagon();
        }
    };

    VersionsHelper helper =
        new DefaultVersionsHelper( new DefaultArtifactFactory(), new DefaultArtifactResolver(), metadataSource, new ArrayList(),
                                   new ArrayList(),
                                   new DefaultArtifactRepository( "", "", new DefaultRepositoryLayout() ),
                                   wagonManager, new Settings(), "", rulesUri, mock( Log.class ), mock( MavenSession.class ),
                                   new DefaultPathTranslator());
    return helper;
}
 
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:21,代码来源:DefaultVersionsHelperTest.java


示例3: setUp

import org.apache.maven.artifact.factory.DefaultArtifactFactory; //导入依赖的package包/类
protected void setUp()
    throws Exception
{
    super.setUp();

    ArtifactHandlerManager manager = new DefaultArtifactHandlerManager();
    this.setVariableValueToObject( manager, "artifactHandlers", new HashMap() );

    artifactFactory = new DefaultArtifactFactory();
    this.setVariableValueToObject( artifactFactory, "artifactHandlerManager", manager );

    DependencyArtifactStubFactory factory = new DependencyArtifactStubFactory( null, false );
    artifacts = factory.getMixedArtifacts();
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:15,代码来源:TestClassifierTypeTranslator.java


示例4: testCreateEffectivePom

import org.apache.maven.artifact.factory.DefaultArtifactFactory; //导入依赖的package包/类
/**
 * Tests method to create effective POM.
 *
 * @throws Exception if something goes wrong.
 */
@Test
public void testCreateEffectivePom()
    throws Exception
{

    String magicValue = "magic-value";
    Properties userProperties = new Properties();
    userProperties.setProperty( "cmd.test.property", magicValue );

    File pomFile = new File( "src/test/resources/cmdpropertysubstituion/pom.xml" );
    ArtifactRepository localRepository = new MavenArtifactRepository();
    localRepository.setLayout( new DefaultRepositoryLayout() );
    ArtifactFactory artifactFactory = new DefaultArtifactFactory();
    ArtifactHandlerManager artifactHandlerManager = new DefaultArtifactHandlerManager();
    setDeclaredField( artifactFactory, "artifactHandlerManager", artifactHandlerManager );
    Map<String, ArtifactHandler> artifactHandlers = new HashMap<String, ArtifactHandler>();
    setDeclaredField( artifactHandlerManager, "artifactHandlers", artifactHandlers );
    DefaultDependencyResolver depencencyResolver = new DefaultDependencyResolver();
    DefaultProjectBuildingRequest projectBuildingRequest = new DefaultProjectBuildingRequest();
    FlattenModelResolver resolver = new FlattenModelResolver( localRepository, artifactFactory,
            depencencyResolver, projectBuildingRequest, Collections.<MavenProject>emptyList() );
    ModelBuildingRequest buildingRequest =
        new DefaultModelBuildingRequest().setPomFile( pomFile ).setModelResolver( resolver ).setUserProperties( userProperties );
    Model effectivePom = FlattenMojo.createEffectivePom( buildingRequest, false );
    assertThat( effectivePom.getName() ).isEqualTo( magicValue );
}
 
开发者ID:mojohaus,项目名称:flatten-maven-plugin,代码行数:32,代码来源:CreateEffectivePomTest.java


示例5: BundleToArtifactTest

import org.apache.maven.artifact.factory.DefaultArtifactFactory; //导入依赖的package包/类
public BundleToArtifactTest() throws NoSuchFieldException, IllegalAccessException {
    factory = new DefaultArtifactFactory();
    ArtifactHandlerManager artifactHandlerManager = new DefaultArtifactHandlerManager();
    Field f = factory.getClass().getDeclaredField("artifactHandlerManager");
    f.setAccessible(true);
    f.set(factory, artifactHandlerManager);
    f.setAccessible(false);

    f = artifactHandlerManager.getClass().getDeclaredField("artifactHandlers");
    f.setAccessible(true);
    f.set(artifactHandlerManager, new HashMap());
    f.setAccessible(false);
}
 
开发者ID:retog,项目名称:karaf-maven-plugin,代码行数:14,代码来源:BundleToArtifactTest.java


示例6: AddToRepositoryMojoTest

import org.apache.maven.artifact.factory.DefaultArtifactFactory; //导入依赖的package包/类
public AddToRepositoryMojoTest() throws NoSuchFieldException, IllegalAccessException {
    factory = new DefaultArtifactFactory();
    ArtifactHandlerManager artifactHandlerManager = new DefaultArtifactHandlerManager();
    Field f = factory.getClass().getDeclaredField("artifactHandlerManager");
    f.setAccessible(true);
    f.set(factory, artifactHandlerManager);
    f.setAccessible(false);

    f = artifactHandlerManager.getClass().getDeclaredField("artifactHandlers");
    f.setAccessible(true);
    f.set(artifactHandlerManager, new HashMap());
    f.setAccessible(false);
}
 
开发者ID:retog,项目名称:karaf-maven-plugin,代码行数:14,代码来源:AddToRepositoryMojoTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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