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


Java ArtifactFactory類代碼示例

本文整理匯總了Java中org.apache.maven.artifact.factory.ArtifactFactory的典型用法代碼示例。如果您正苦於以下問題:Java ArtifactFactory類的具體用法?Java ArtifactFactory怎麽用?Java ArtifactFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ArtifactFactory類屬於org.apache.maven.artifact.factory包,在下文中一共展示了ArtifactFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDependencyTree

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的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: DefaultWarPackagingContext

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
/**
 * @param webappDirectory The web application directory.
 * @param webappStructure The web app structure.
 * @param overlayManager The overlay manager.
 * @param filterWrappers The filter wrappers
 * @param nonFilteredFileExtensions The non filtered file extensions.
 * @param filteringDeploymentDescriptors The filtering deployment descriptors.
 * @param artifactFactory The artifact factory.
 * @param resourceEncoding The resource encoding.
 * @param useJvmChmod use Jvm chmod or not.
 */
public DefaultWarPackagingContext( File webappDirectory, final WebappStructure webappStructure,
                                   final OverlayManager overlayManager,
                                   List<FileUtils.FilterWrapper> filterWrappers,
                                   List<String> nonFilteredFileExtensions,
                                   boolean filteringDeploymentDescriptors, ArtifactFactory artifactFactory,
                                   String resourceEncoding, boolean useJvmChmod )
{
    this.webappDirectory = webappDirectory;
    this.webappStructure = webappStructure;
    this.overlayManager = overlayManager;
    this.filterWrappers = filterWrappers;
    this.artifactFactory = artifactFactory;
    this.filteringDeploymentDescriptors = filteringDeploymentDescriptors;
    this.nonFilteredFileExtensions =
        nonFilteredFileExtensions == null ? Collections.<String>emptyList() : nonFilteredFileExtensions;
    this.resourceEncoding = resourceEncoding;
    // This is kinda stupid but if we loop over the current overlays and we request the path structure
    // it will register it. This will avoid wrong warning messages in a later phase
    for ( String overlayId : overlayManager.getOverlayIds() )
    {
        webappStructure.getStructure( overlayId );
    }
    this.useJvmChmod = useJvmChmod;
}
 
開發者ID:zhegexiaohuozi,項目名稱:maven-seimicrawler-plugin,代碼行數:36,代碼來源:AbstractWarMojo.java

示例3: MavenEnvironment

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的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

示例4: ForkedRunner

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
ForkedRunner(final Log log, final int jmxPort, final String vmArgs, final List<String> testClasspathElements,
             final List<String> stepImplementationArtifacts, final ArtifactResolver artifactResolver,
             final ArtifactFactory artifactFactory, final ProjectBuilder projectBuilder,
             final ArtifactRepository localRepository, final List<ArtifactRepository> remoteRepositories,
             final ArtifactMetadataSource artifactMetadataSource) throws MojoExecutionException {

    this.log = log;
    this.jmxPort = jmxPort;
    this.vmArgs = vmArgs;
    this.testClasspathElements = testClasspathElements;
    this.stepImplementationArtifacts = stepImplementationArtifacts;
    this.artifactResolver = artifactResolver;
    this.artifactFactory = artifactFactory;
    this.projectBuilder = projectBuilder;
    this.localRepository = localRepository;
    this.remoteRepositories = remoteRepositories;
    this.artifactMetadataSource = artifactMetadataSource;

    this.substepsJmxClient = new SubstepsJMXClient();

    this.substepsJmxClient.setNotificiationHandler(this);

    this.consumer = startMBeanJVM();

    initialiseClient();
}
 
開發者ID:Substeps,項目名稱:substeps-framework,代碼行數:27,代碼來源:ForkedRunner.java

示例5: customize

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
public void customize(@Nullable MavenWorkspaceMap workspaceMap,
                      boolean failOnUnresolvedDependency,
                      @NotNull MavenServerConsole console,
                      @NotNull MavenServerProgressIndicator indicator,
                      boolean alwaysUpdateSnapshots) {
  try {
    ((CustomArtifactFactory)getComponent(ArtifactFactory.class)).customize();
    ((CustomArtifactFactory)getComponent(ProjectArtifactFactory.class)).customize();
    ((CustomArtifactResolver)getComponent(ArtifactResolver.class)).customize(workspaceMap, failOnUnresolvedDependency);
    ((CustomRepositoryMetadataManager)getComponent(RepositoryMetadataManager.class)).customize(workspaceMap);
    ((CustomWagonManager)getComponent(WagonManager.class)).customize(failOnUnresolvedDependency);

    setConsoleAndIndicator(console, indicator);
  }
  catch (Exception e) {
    throw rethrowException(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:Maven2ServerEmbedderImpl.java

示例6: DependenciesRenderer

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
/**
 * 
 * @param sink
 * @param project
 * @param mavenProjectBuilder
 * @param locale
 * @param listener
 */
public DependenciesRenderer(	Sink sink, 
								MavenProject project, 
								MavenProjectBuilder mavenProjectBuilder,
								ArtifactRepository localRepository,
								ArtifactFactory factory,
								I18N i18n,
								Locale locale, 
								ReportingResolutionListener listener,
								Log log )
{
    super( sink );

    this.project = project;
    this.locale = locale;
    this.listener = listener;
    this.mavenProjectBuilder = mavenProjectBuilder;
    this.localRepository = localRepository;
    this.i18n 	= i18n;
    this.factory = factory;
    this.log = log;
}
 
開發者ID:bsorrentino,項目名稱:maven-confluence-plugin,代碼行數:30,代碼來源:DependenciesRenderer.java

示例7: resolve

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
public static Collection<Artifact> resolve(
		final ArtifactFactory artifactFactory,
		final ArtifactResolver artifactResolver,
		final ArtifactRepository localRepository,
		final ArtifactMetadataSource artifactMetadataSource,
		final Dependency[] dependencies, final MavenProject project)
		throws InvalidDependencyVersionException,
		ArtifactResolutionException, ArtifactNotFoundException {
	if (dependencies == null) {
		return Collections.emptyList();
	}

	@SuppressWarnings("unchecked")
	final Set<Artifact> artifacts = MavenMetadataSource.createArtifacts(
			artifactFactory, Arrays.asList(dependencies), "runtime", null,
			project);

	for (Artifact artifact : artifacts) {
		artifactResolver.resolve(artifact,

		project.getRemoteArtifactRepositories(), localRepository);
	}

	final Set<Artifact> resolvedArtifacts = artifacts;
	return resolvedArtifacts;
}
 
開發者ID:highsource,項目名稱:maven-jaxb2-plugin,代碼行數:27,代碼來源:ArtifactUtils.java

示例8: getResolvedArtifact

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
public static Artifact getResolvedArtifact(Dependency dependency, ArtifactFactory artifactFactory,
		List<?> remoteRepositories, ArtifactRepository localRepository, ArtifactResolver resolver, String scope,
		String artifactSystemPath) throws MojoExecutionException {
	String groupId = dependency.getGroupId();
	String artifactId = dependency.getArtifactId();
	String version = dependency.getVersion();
	String type = dependency.getType();

	if (null != artifactSystemPath) {
		return getResolvedArtifact(groupId, artifactId, version, type, scope, new File(artifactSystemPath),
				artifactFactory, remoteRepositories, localRepository, resolver);
	} else {
		return getResolvedArtifact(groupId, artifactId, version, type, scope, null, artifactFactory,
				remoteRepositories, localRepository, resolver);
	}
}
 
開發者ID:wso2,項目名稱:maven-tools,代碼行數:17,代碼來源:MavenUtils.java

示例9: getResolvedArtifactPom

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
/**
 * Resolve maven POM of the given artifact
 * 
 * @param dependency
 * @param artifactFactory
 * @param remoteRepositories
 * @param localRepository
 * @param resolver
 * @return resolved POM artifact
 * @throws MojoExecutionException
 */
public static Artifact getResolvedArtifactPom(Dependency dependency, ArtifactFactory artifactFactory,
		List<?> remoteRepositories, ArtifactRepository localRepository, ArtifactResolver resolver)
		throws MojoExecutionException {
	Artifact artifact = artifactFactory.createProjectArtifact(dependency.getGroupId(), dependency.getArtifactId(),
			dependency.getVersion());
	if (null != dependency.getScope()) {
		artifact.setScope(dependency.getScope());
	}
	if (null != dependency.getSystemPath()) {
		artifact.setFile(new File(dependency.getSystemPath()));
	}

	try {
		resolver.resolve(artifact, remoteRepositories, localRepository);
	} catch (ArtifactResolutionException | ArtifactNotFoundException e) {
		throw new MojoExecutionException("Failed to resolve artifacts in specified repositories.", e);
	}
	return artifact;
}
 
開發者ID:wso2,項目名稱:maven-tools,代碼行數:31,代碼來源:MavenUtils.java

示例10: getProcessedP2LanucherFiles

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
public static ArrayList getProcessedP2LanucherFiles(ArrayList processedP2LauncherFiles, EquinoxLauncher equinoxLauncher, MavenProject project, ArtifactFactory artifactFactory, List remoteRepositories, ArtifactRepository localRepository, ArtifactResolver resolver) throws MojoExecutionException {
    if (processedP2LauncherFiles != null)
        return processedP2LauncherFiles;
    processedP2LauncherFiles = new ArrayList();
    Iterator iter = equinoxLauncher.getLauncherFiles().iterator();
    while (iter.hasNext()) {
        Object obj = iter.next();
        Bundle b;
        if (obj instanceof FeatureArtifact) {
            b = (Bundle) obj;
        } else if (obj instanceof String) {
            b = Bundle.getBundle(obj.toString());
        } else
            b = (Bundle) obj;
        try {
            b.resolveVersion(project);
        } catch (MojoExecutionException e) {
            b.setVersion(P2Constants.getDefaultVersion(b.getGroupId(), b.getArtifactId()));
            if (b.getVersion() == null)
                throw e;
        }
        b.setArtifact(MavenUtils.getResolvedArtifact(b, artifactFactory, remoteRepositories, localRepository, resolver));
        processedP2LauncherFiles.add(b);
    }
    return processedP2LauncherFiles;
}
 
開發者ID:wso2,項目名稱:maven-tools,代碼行數:27,代碼來源:P2Utils.java

示例11: customize

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
@Override
public void customize(@Nullable MavenWorkspaceMap workspaceMap,
                      boolean failOnUnresolvedDependency,
                      @NotNull MavenServerConsole console,
                      @NotNull MavenServerProgressIndicator indicator) throws RemoteException {

  try {
    ((CustomMaven3ArtifactFactory)getComponent(ArtifactFactory.class)).customize();
    ((CustomMaven3ArtifactResolver)getComponent(ArtifactResolver.class)).customize(workspaceMap, failOnUnresolvedDependency);
    ((CustomMaven3RepositoryMetadataManager)getComponent(RepositoryMetadataManager.class)).customize(workspaceMap);
    //((CustomMaven3WagonManager)getComponent(WagonManager.class)).customize(failOnUnresolvedDependency);

    myWorkspaceMap = workspaceMap;

    setConsoleAndIndicator(console, new MavenServerProgressIndicatorWrapper(indicator));
  }
  catch (Exception e) {
    throw rethrowException(e);
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:21,代碼來源:Maven3ServerEmbedderImpl.java

示例12: customize

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
public void customize(@Nullable MavenWorkspaceMap workspaceMap,
                      boolean failOnUnresolvedDependency,
                      @NotNull MavenServerConsole console,
                      @NotNull MavenServerProgressIndicator indicator) {
  try {
    ((CustomArtifactFactory)getComponent(ArtifactFactory.class)).customize();
    ((CustomArtifactFactory)getComponent(ProjectArtifactFactory.class)).customize();
    ((CustomArtifactResolver)getComponent(ArtifactResolver.class)).customize(workspaceMap, failOnUnresolvedDependency);
    ((CustomRepositoryMetadataManager)getComponent(RepositoryMetadataManager.class)).customize(workspaceMap);
    ((CustomWagonManager)getComponent(WagonManager.class)).customize(failOnUnresolvedDependency);

    setConsoleAndIndicator(console, indicator);
  }
  catch (Exception e) {
    throw rethrowException(e);
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:18,代碼來源:Maven2ServerEmbedderImpl.java

示例13: DefaultArtifactDownloader

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
public DefaultArtifactDownloader(Log log,
                                 ArtifactFactory artifactFactory,
                                 ArtifactResolver artifactResolver,
                                 ArtifactRepository localRepository,
                                 List<ArtifactRepository> remoteArtifactRepositories,
                                 String remoteRepositories,
                                 Map<String, ArtifactRepositoryLayout> repositoryLayouts,
                                 ArtifactRepositoryFactory artifactRepositoryFactory,
                                 ArtifactMetadataSource artifactMetadataSource,
                                 boolean enableOpooPressRepos) {
    this.artifactFactory = artifactFactory;
    this.artifactResolver = artifactResolver;
    this.localRepository = localRepository;
    this.remoteArtifactRepositories = remoteArtifactRepositories;
    this.remoteRepositories = remoteRepositories;
    this.repositoryLayouts = repositoryLayouts;
    this.artifactRepositoryFactory = artifactRepositoryFactory;
    this.artifactMetadataSource = artifactMetadataSource;
    this.enableOpooPressRepos = enableOpooPressRepos;
    this.log = log;
}
 
開發者ID:opoo,項目名稱:opoopress,代碼行數:22,代碼來源:DefaultArtifactDownloader.java

示例14: testArtifactTouchFileName

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
public void testArtifactTouchFileName() throws Exception
{
    ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );

    ArtifactRepository localRepository = localRepository();

    Artifact a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", null );
    File file = new File( localRepository.getBasedir(), 
                          localRepository.pathOf( a ) );
    a.setFile( file );

    assertEquals( "a-0.0.1-SNAPSHOT.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );

    a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" );
    file = new File( localRepository.getBasedir(), 
                          localRepository.pathOf( a ) );
    a.setFile( file );

    assertEquals( "a-0.0.1-SNAPSHOT-classifier.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:21,代碼來源:DefaultUpdateCheckManagerTest.java

示例15: setUp

import org.apache.maven.artifact.factory.ArtifactFactory; //導入依賴的package包/類
@Override
protected void setUp()
    throws Exception
{
    super.setUp();
    artifactFactory = lookup( ArtifactFactory.class);        
    artifactRepositoryFactory = lookup( ArtifactRepositoryFactory.class );

    RepositorySystemSession repoSession = initRepoSession();
    MavenSession session =
        new MavenSession( getContainer(), repoSession, new DefaultMavenExecutionRequest(),
                          new DefaultMavenExecutionResult() );

    LegacySupport legacySupport = lookup(LegacySupport.class);
    legacySupport.setSession( session );
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:17,代碼來源:AbstractArtifactComponentTestCase.java


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