use of org.commonjava.maven.atlas.ident.ref.ArtifactRef in project pom-manipulation-ext by release-engineering.
the class DependencyRemovalManipulator method scanDependencies.
private boolean scanDependencies(HashMap<ArtifactRef, Dependency> resolvedDependencies, List<ProjectRef> dependenciesToRemove, List<Dependency> dependencies) {
boolean result = false;
if (dependencies != null) {
for (ArtifactRef pvr : resolvedDependencies.keySet()) {
if (dependenciesToRemove.contains(pvr.asProjectRef())) {
logger.debug("Removing {} ", resolvedDependencies.get(pvr));
dependencies.remove(resolvedDependencies.get(pvr));
result = true;
}
}
}
return result;
}
use of org.commonjava.maven.atlas.ident.ref.ArtifactRef in project pom-manipulation-ext by release-engineering.
the class PluginState method setRemoteRESTOverrides.
public void setRemoteRESTOverrides(Map<ArtifactRef, String> overrides) {
for (ArtifactRef a : overrides.keySet()) {
Plugin p = new Plugin();
p.setGroupId(a.getGroupId());
p.setArtifactId(a.getArtifactId());
p.setVersion(overrides.get(a));
remoteRESTplugins.add(p);
}
}
use of org.commonjava.maven.atlas.ident.ref.ArtifactRef in project pom-manipulation-ext by release-engineering.
the class ProjectInheritanceTest method testVerifyProjectVersion.
@Test
public void testVerifyProjectVersion() throws Exception {
final ManipulationSession session = new ManipulationSession();
final File projectroot = new File(TestUtils.resolveFileResource(RESOURCE_BASE, "").getParentFile().getParentFile().getParentFile().getParentFile(), "integration-test/src/it/project-inheritance/pom.xml");
PomIO pomIO = new PomIO();
List<Project> projects = pomIO.parseProject(projectroot);
for (Project p : projects) {
if (p.getPom().equals(projectroot)) {
HashMap<ArtifactRef, Dependency> deps = p.getResolvedManagedDependencies(session);
for (ArtifactRef a : deps.keySet()) {
assertFalse(a.getVersionString().contains("project.version"));
}
deps = p.getResolvedDependencies(session);
assertTrue(deps.size() == 1);
for (ArtifactRef a : deps.keySet()) {
assertFalse(a.getVersionString().contains("project.version"));
}
assertFalse(deps.containsKey("org.mockito:mockito-all:jar:*"));
deps = p.getAllResolvedDependencies(session);
assertTrue(deps.size() == 3);
for (ArtifactRef a : deps.keySet()) {
assertFalse(a.getVersionString().contains("project.version"));
if (a.getGroupId().equals("org.mockito")) {
assertTrue(a.getVersionString().contains("*"));
}
}
assertTrue(deps.containsKey(SimpleArtifactRef.parse("org.mockito:mockito-all:jar:*")));
}
}
}
use of org.commonjava.maven.atlas.ident.ref.ArtifactRef in project pom-manipulation-ext by release-engineering.
the class PropertyInterpolatorTest method testResolveProjectDependencies.
@Test
public void testResolveProjectDependencies() throws Exception {
final Model model = TestUtils.resolveModelResource(RESOURCE_BASE, "infinispan-bom-8.2.0.Final.pom");
final Project project = new Project(model);
HashMap<ArtifactRef, Dependency> deps = project.getResolvedManagedDependencies(new ManipulationSession());
assertTrue(deps.size() == 66);
}
Aggregations