public List<Dependency> getManagedDependencies() { DependencyManagement depMngt = project.getDependencyManagement(); return ( depMngt != null ) ? Collections.unmodifiableList( depMngt.getDependencies() ) : Collections.<Dependency>emptyList(); }
if (skipDependencyManagement || project.getDependencyManagement() == null) { return null; for (org.apache.maven.model.Dependency dependency : project.getDependencyManagement().getDependencies()) { try { nodes.add(toDependencyNode(buildingRequest, null, dependency));
MavenProject project = buildFromRepository(artifact, parentSearchRepositories, localRepository, false); DependencyManagement depMgmt = project.getDependencyManagement();
project.getDependencyManagement(), project.getParent() ) );
if ( repositorySystem != null ) DependencyManagement dependencyManagement = project.getDependencyManagement(); if ( ( dependencyManagement != null ) && ( ( dependencyManagement.getDependencies() ) != null ) && ( dependencyManagement.getDependencies().size() > 0 ) )
DependencyManagement depMgmt = rel.project.getDependencyManagement(); managedDependencies = ( depMgmt != null ) ? depMgmt.getDependencies() : null;
DependencyManagement depMgmt = project.getDependencyManagement(); if ( depMgmt != null )
public DependencyManagement getDependencyManagement() { return wrapped.getDependencyManagement(); }
@Override protected Collection<Dependency> getMavenDependencies(MavenProject project) { DependencyManagement dependencyManagement = project.getDependencyManagement(); if (dependencyManagement != null) { return dependencyManagement.getDependencies(); } else { return Collections.emptyList(); } }
public DependencyManagement getDependencyManagement() { return getMavenProject().getDependencyManagement(); }
public DependencyManagement getDependencyManagement() { return getMavenProject().getDependencyManagement(); } //-- DependencyManagement getDependencyManagement()
public DependencyManagement getDependencyManagement() { return getDelegate().getDependencyManagement(); }
@SuppressWarnings("unchecked") private String getDependencyVersionFromDependencyManagementOrThrowExceptionIfNotAvailable(Dependency dep) { DependencyManagement dependencyManagement = project.getDependencyManagement(); if (dependencyManagement != null) { List<Dependency> managedDeps = dependencyManagement.getDependencies(); for (Dependency managedDep : managedDeps) { if (managedDep.getArtifactId().equals(dep.getArtifactId()) && managedDep.getGroupId().equals(dep.getGroupId())) { return managedDep.getVersion(); } } throw new IllegalArgumentException(format( "Unable to determine version for dependency: %s:%s", dep.getGroupId(), dep.getArtifactId())); } else { throw new IllegalArgumentException(format( "Unable to determine version for dependency: %s:%s. DependencyManagement is null", dep.getGroupId(), dep.getArtifactId())); } }
private void configureArtifact(ArtifactImpl artifact, MavenProject mavenProject) { artifact.getDependencyManagerDependencies().clear(); if (mavenProject.getDependencyManagement() != null) { List<Dependency> dependencies = mavenProject.getDependencyManagement().getDependencies(); for (Dependency dependency : dependencies) { artifact.getDependencyManagerDependencies().add(MavenHelper.createArtifactDependency(dependency)); } } }
private void fillMissingArtifactVersion(ArtifactItem artifactItem) throws MojoExecutionException { List<Dependency> deps = project.getDependencies(); List<Dependency> depMngt = project.getDependencyManagement() == null ? Collections.<Dependency>emptyList() : project.getDependencyManagement().getDependencies(); if ( !findDependencyVersion( artifactItem, deps, false ) && ( project.getDependencyManagement() == null || !findDependencyVersion( artifactItem, depMngt, false ) ) && !findDependencyVersion( artifactItem, deps, true ) && ( project.getDependencyManagement() == null || !findDependencyVersion( artifactItem, depMngt, true ) ) ) { throw new MojoExecutionException( "Unable to find artifact version of " + artifactItem.getGroupId() + ":" + artifactItem.getArtifactId() + " in either dependency list or in project's dependency management." ); } }
private Set<ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project, PomPropertyResolver propertyResolver) { this.log.debug("\t\tChecking managed dependencies"); DependencyManagement dependencyManagement = project.getDependencyManagement(); if (dependencyManagement != null) { Collection<Dependency> snapshots = Collections2.filter(dependencyManagement.getDependencies(), new IsSnapshotDependency(propertyResolver)); HashSet<ArtifactCoordinates> snapshotDependencies = Sets .newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE)); filterMultiModuleDependencies(snapshotDependencies); return snapshotDependencies; } return Collections.emptySet(); }
private Set<ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project, PomPropertyResolver propertyResolver) { this.log.debug("\t\tChecking managed dependencies"); DependencyManagement dependencyManagement = project.getDependencyManagement(); if (dependencyManagement != null) { Collection<Dependency> snapshots = Collections2.filter(dependencyManagement.getDependencies(), new IsSnapshotDependency(propertyResolver)); HashSet<ArtifactCoordinates> snapshotDependencies = Sets .newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE)); filterMultiModuleDependencies(snapshotDependencies); return snapshotDependencies; } return Collections.emptySet(); }
/** * Returns all dependencies defined in dependency management of the root pom. * * @return */ private Set<Artifact> getProjectDependencyManagement() { Set<Artifact> result = new LinkedHashSet<Artifact>(); DependencyManagement dependencyManagement = getProject().getDependencyManagement(); if (dependencyManagement != null) { for (Dependency dependency : dependencyManagement.getDependencies()) { result.add(toArtifact(dependency)); } } return result; }
public void addConfiguredDependencyManagement( DependencyManagement dependencyManagement ) { if ( getMavenProject().getDependencyManagement() == null ) { // is is a bit disappointing that we have to access the encapsulated model to fix the NPE getMavenProject().getModel().setDependencyManagement(new DependencyManagement()); } getMavenProject().getDependencyManagement().setDependencies( dependencyManagement.getDependencies() ); }
@SuppressWarnings("unchecked") protected void injectDependencyDefaults(Dependency[] dependencies) { if (dependencies != null) { final Map<String, Dependency> dependencyMap = new TreeMap<String, Dependency>(); for (final Dependency dependency : dependencies) { if (dependency.getScope() == null) { dependency.setScope(Artifact.SCOPE_RUNTIME); } dependencyMap.put(dependency.getManagementKey(), dependency); } final DependencyManagement dependencyManagement = getProject().getDependencyManagement(); if (dependencyManagement != null) { merge(dependencyMap, dependencyManagement.getDependencies()); } merge(dependencyMap, getProjectDependencies()); } }