本文整理汇总了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;未经允许,请勿转载。 |
请发表评论