project.setDependencyArtifacts( project.createArtifacts( artifactFactory, null, null ) );
artifacts = project.createArtifacts( artifactFactory, artifact.getScope(), artifact.getDependencyFilter() );
getLog().debug("Attempting to dynamically resolve: " + artifact); try { Set resolvedArtifacts = project.createArtifacts( artifactFactory, null, null);
dep.getScope(), dep.getType() ); Set artifacts = project.createArtifacts( artifactFactory, null, null); ArtifactResolutionResult result = artifactResolver.resolveTransitively(artifacts, artifact, remoteRepositories, localRepository, artifactMetadataSource);
public Set<Artifact> createArtifacts(ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter dependencyFilter) throws InvalidDependencyVersionException { return wrapped.createArtifacts(artifactFactory, inheritedScope, dependencyFilter); }
public Set createArtifacts(final ArtifactFactory factory, final String s, final ArtifactFilter filter) throws InvalidDependencyVersionException { return getDelegate().createArtifacts(factory, s, filter); }
private void addDepenciesToProject(MavenProject project, Set dependencies) throws MojoExecutionException { List amalgamatedDependencies = new ArrayList(); amalgamatedDependencies.addAll(dependencies); amalgamatedDependencies.addAll(project.getDependencies()); project.setDependencies(amalgamatedDependencies); try { project.setDependencyArtifacts(project.createArtifacts(artifactFactory, null, null)); } catch (InvalidDependencyVersionException e) { throw new MojoExecutionException("Failed to resolve dependency artifacts.", e); } }
try { MavenProject project = mavenProjectBuilder.buildFromRepository(artifact, this.remoteRepos, this.localRepository); Set<Artifact> dependencyArtifacts = project.createArtifacts( this.artifactFactory, Artifact.SCOPE_RUNTIME, new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME ) ); Set<Artifact> transitiveDependencies = new HashSet<Artifact>();
/** * Fixup an artifact. * @param artifact Artifact to fixup. * @throws Exception If anything goes wrong. */ protected void fixupRepositoryArtifact(Artifact artifact) throws Exception { // Resolve it resolver.resolve(artifact, remoteRepositories, localRepository); File artifactFile = artifact.getFile(); // Also, create a project for it MavenProject mavenProject = mavenProjectBuilder.buildFromRepository( artifact, remoteRepositories, localRepository); for (Object createdArtifact : mavenProject.createArtifacts(artifactFactory, null, null)) { Artifact art = (Artifact) createdArtifact; if (art.getType().equals("war")) { // Sigh... Artifact art2 = artifactFactory.createArtifactWithClassifier( art.getGroupId(), art.getArtifactId(), art.getVersion(), "pom", null); fixupRepositoryArtifact(art2); } } MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model pomFile = pomReader.read(new FileReader(artifactFile)); fixModelAndSaveInRepository(artifact, pomFile); }
synapseRuntimeDeps = synapseCoreProject.createArtifacts(artifactFactory, Artifact.SCOPE_RUNTIME, new TypeArtifactFilter("jar")); } catch (InvalidDependencyVersionException e) {
for (Object artifact : mp2.createArtifacts(artifactFactory, null, null))
.getVersion(), artifact.getClassifier(), "pom"); MavenProject pomProject = mavenProjectBuilder.buildFromRepository(pomArtifact, this.remoteRepositories, this.localRepository); Set<org.apache.maven.artifact.Artifact> dependents = pomProject.createArtifacts(this.artifactFactory, null, null); ArtifactResolutionResult result = resolver.resolveTransitively(dependents, pomArtifact, this.localRepository, this.remoteRepositories, this.metadataSource, null);
depArtifacts = project.createArtifacts( artifactFactory, null, scopeFilter );
.getVersion(), artifact.getClassifier(), "pom"); MavenProject pomProject = mavenProjectBuilder.buildFromRepository(pomArtifact, this.remoteRepositories, this.localRepository); Set<org.apache.maven.artifact.Artifact> dependents = pomProject.createArtifacts(this.artifactFactory, null, null); ArtifactResolutionResult result = resolver.resolveTransitively(dependents, pomArtifact, this.localRepository, this.remoteRepositories, this.metadatSource, null);
final MavenProject stepImplementationProject = this.mavenProjectBuilder.buildFromRepository( stepImplementationPomArtifact, this.remoteRepositories, this.localRepository); final Set<Artifact> stepImplementationArtifacts = stepImplementationProject.createArtifacts( this.artifactFactory, null, null);
public DependencyTree getDependencies(final MavenProject project) throws ProjectBuildingException, InvalidDependencyVersionException, ArtifactResolutionException { assert project != null; Map managedVersions = getManagedVersionMap(project, artifactFactory); DependencyResolutionListener listener = new DependencyResolutionListener(); if (project.getDependencyArtifacts() == null) { project.setDependencyArtifacts(project.createArtifacts(artifactFactory, null, null)); } artifactCollector.collect( project.getDependencyArtifacts(), project.getArtifact(), managedVersions, getArtifactRepository(), project.getRemoteArtifactRepositories(), artifactMetadataSource, null, Collections.singletonList(listener)); return listener.getDependencyTree(); }
public DependencyTree getDependencies(final MavenProject project) throws ProjectBuildingException, InvalidDependencyVersionException, ArtifactResolutionException { assert project != null; Map managedVersions = getManagedVersionMap(project, artifactFactory); DependencyResolutionListener listener = new DependencyResolutionListener(); if (project.getDependencyArtifacts() == null) { project.setDependencyArtifacts(project.createArtifacts(artifactFactory, null, null)); } artifactCollector.collect( project.getDependencyArtifacts(), project.getArtifact(), managedVersions, getArtifactRepository(), project.getRemoteArtifactRepositories(), artifactMetadataSource, null, Collections.singletonList(listener)); return listener.getDependencyTree(); }
Set<Artifact> dependencyArtifacts = project.createArtifacts(artifactFactory, null, null); snapshots.addAll(checkArtifacts(dependencyArtifacts, originalReactorVersions, AT_DEPENDENCY));
/** * This method resolves the dependency artifacts from the project. * * @param theProject The POM. * @return resolved set of dependency artifacts. * * @throws ArtifactResolutionException * @throws ArtifactNotFoundException * @throws InvalidDependencyVersionException */ @SuppressWarnings("unchecked") protected Set<Artifact> resolveDependencyArtifacts(MavenProject theProject) throws Exception { AndArtifactFilter filter = new AndArtifactFilter(); filter.add(new ScopeArtifactFilter(Artifact.SCOPE_TEST)); filter.add(new ArtifactFilter(){ public boolean include(Artifact artifact) { return !artifact.isOptional(); } }); //TODO follow the dependenciesManagement and override rules Set<Artifact> artifacts = theProject.createArtifacts(factory, Artifact.SCOPE_RUNTIME, filter); for (Artifact artifact : artifacts) { resolver.resolve(artifact, remoteRepos, localRepo); } return artifacts; }
dependencyArtifacts = project.createArtifacts( factory, null, null );