/** * @todo the lazy initialisation of this makes me uneasy. * @return {@link Set} < {@link Artifact} > */ public Set createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter dependencyFilter ) throws InvalidDependencyVersionException { return MavenMetadataSource.createArtifacts( artifactFactory, getDependencies(), inheritedScope, dependencyFilter, this ); }
public List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories ) throws ArtifactMetadataRetrievalException { MetadataResolutionRequest request = new DefaultMetadataResolutionRequest(); injectSession( request ); request.setArtifact( artifact ); request.setLocalRepository( localRepository ); request.setRemoteRepositories( remoteRepositories ); return retrieveAvailableVersions( request ); }
&& ( !request.isForceUpdate() || hasFile( cached.getPomArtifact() ) ) ) ProjectRelocation rel = retrieveRelocatedProject( artifact, request ); Artifact dependencyArtifact = createDependencyArtifact( dependency, artifact, pomArtifact ); Artifact managedArtifact = createDependencyArtifact( managedDependency, null, pomArtifact ); aggregateRepositories( request.getRemoteRepositories(), pomRepositories );
ProjectRelocation rel = retrieveRelocatedProject( artifact, localRepository, remoteRepositories ); if ( project == null || getRelocationKey( artifact ).equals( getRelocationKey( project.getArtifact() ) ) )
getLogger().warn( "POM for \'" + pomArtifact + "\' is invalid.\n\nIts dependencies (if any) will NOT be available to the current build." ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "Reason: " + e.getMessage() ); getLogger().debug( "\nValidation Errors:" ); for ( Iterator i = validationResult.getMessages().iterator(); i.hasNext(); ) getLogger().debug( i.next().toString() ); getLogger().debug( "\n" ); if ( available != null && !available.isEmpty() ) artifact.setAvailableVersions( retrieveAvailableVersions( artifact, localRepository, remoteRepositories ) ); getLogger().warn( "While downloading " + pomArtifact.getGroupId() + ":" + pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" ); getLogger().debug( "While downloading " + pomArtifact.getGroupId() + ":" + pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" );
configuration.setProcessPlugins( false ); configuration.setRepositoryMerging( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT ); configuration.setSystemProperties( getSystemProperties() ); configuration.setRepositorySession( legacySupport.getRepositorySession() ); project = getProjectBuilder().build( pomArtifact, configuration ).getProject(); ModelProblem missingParentPom = hasMissingParentPom( e ); if ( missingParentPom != null ) if ( isMissingPom( e ) ) else if ( isNonTransferrablePom( e ) ) new DefaultMetadataResolutionRequest( repositoryRequest ); metadataRequest.setArtifact( artifact ); available = retrieveAvailableVersions( metadataRequest ); artifact.setAvailableVersions( available );
throws ArtifactMetadataRetrievalException ProjectRelocation rel = retrieveRelocatedProject( artifact, localRepository, remoteRepositories ); List repositories = aggregateRepositoryLists( remoteRepositories, project.getRemoteArtifactRepositories() );
@Deprecated public Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter filter ) throws InvalidDependencyVersionException { return MavenMetadataSource.createArtifacts( artifactFactory, getDependencies(), inheritedScope, filter, this ); }
@Override public Set<Artifact> createArtifacts( MavenProject project ) throws InvalidDependencyVersionException { return MavenMetadataSource.createArtifacts( artifactFactory, project.getDependencies(), null, null, project ); }
private Set<Artifact> createDependencyArtifacts( MavenProject project, List<Dependency> dependencies ) throws DependenciesToolException { try { return MavenMetadataSource.createArtifacts( artifactFactory, dependencies, null, null, project ); } catch ( InvalidDependencyVersionException e ) { throw new DependenciesToolException( e ); } }
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); } @SuppressWarnings("unchecked") final Set<Artifact> resolvedArtifacts = artifacts; return resolvedArtifacts; }
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; }
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; }
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 ); } @SuppressWarnings( "unchecked" ) final Set<Artifact> resolvedArtifacts = artifacts; return resolvedArtifacts; } public static final Function<Artifact, File> GET_FILE = new Function<Artifact, File>()
public static Collection<Artifact> resolveTransitively( 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); final ArtifactResolutionResult artifactResolutionResult = artifactResolver .resolveTransitively(artifacts, project.getArtifact(), project.getRemoteArtifactRepositories(), localRepository, artifactMetadataSource); @SuppressWarnings("unchecked") final Set<Artifact> resolvedArtifacts = artifactResolutionResult .getArtifacts(); return resolvedArtifacts; }
public static Collection<Artifact> resolveTransitively( 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); final ArtifactResolutionResult artifactResolutionResult = artifactResolver .resolveTransitively(artifacts, project.getArtifact(), project.getRemoteArtifactRepositories(), localRepository, artifactMetadataSource); @SuppressWarnings("unchecked") final Set<Artifact> resolvedArtifacts = artifactResolutionResult .getArtifacts(); return resolvedArtifacts; }
List<Dependency> dependencies = rootProject.getDependencies(); Set<Artifact> dependencyArtifacts = MavenMetadataSource.createArtifacts( artifactFactory, dependencies, null, null, null ); dependencyArtifacts.add( rootProject.getArtifact() ); result = resolver.resolveTransitively( dependencyArtifacts, rootArtifact,
public static Collection<Artifact> resolveTransitively( 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); final ArtifactResolutionResult artifactResolutionResult = artifactResolver .resolveTransitively(artifacts, project.getArtifact(), project.getRemoteArtifactRepositories(), localRepository, artifactMetadataSource); @SuppressWarnings("unchecked") final Set<Artifact> resolvedArtifacts = artifactResolutionResult .getArtifacts(); return resolvedArtifacts; }
List<Dependency> dependencies = rootProject.getDependencies(); Set<Artifact> dependencyArtifacts = MavenMetadataSource.createArtifacts( artifactFactory, dependencies, null, null, null ); dependencyArtifacts.add( rootProject.getArtifact() ); result = resolver.resolveTransitively( dependencyArtifacts, rootArtifact,
public static Collection<Artifact> resolveTransitively( 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 ); final ArtifactResolutionResult artifactResolutionResult = artifactResolver.resolveTransitively( artifacts, project.getArtifact(), project.getRemoteArtifactRepositories(), localRepository, artifactMetadataSource ); @SuppressWarnings( "unchecked" ) final Set<Artifact> resolvedArtifacts = artifactResolutionResult.getArtifacts(); return resolvedArtifacts; }