Restore the gathering of artifacts on resolve
Project: http://git-wip-us.apache.org/repos/asf/ant-ivyde/repo Commit: http://git-wip-us.apache.org/repos/asf/ant-ivyde/commit/829b8026 Tree: http://git-wip-us.apache.org/repos/asf/ant-ivyde/tree/829b8026 Diff: http://git-wip-us.apache.org/repos/asf/ant-ivyde/diff/829b8026 Branch: refs/heads/master Commit: 829b802638dca482062ea40f691918b40e79f378 Parents: 7716af8 Author: Nicolas LaleveÌe <nicolas.lale...@hibnet.org> Authored: Sun Jul 1 14:50:34 2018 +0200 Committer: Nicolas LaleveÌe <nicolas.lale...@hibnet.org> Committed: Sun Jul 1 14:50:34 2018 +0200 ---------------------------------------------------------------------- .../internal/eclipse/resolve/IvyResolver.java | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/829b8026/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java ---------------------------------------------------------------------- diff --git a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java index 7dddf15..ba6bfc8 100644 --- a/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java +++ b/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/resolve/IvyResolver.java @@ -260,21 +260,23 @@ public class IvyResolver { ResolveResult result = new ResolveResult(report); - Map<Artifact, ArtifactDownloadReport> workspaceArtifacts = IvyContext.getContext() - .get(WorkspaceResolver.IVYDE_WORKSPACE_ARTIFACT_REPORTS); + ArtifactDownloadReport[] artifactReports = report.getArtifactsReports(null, false); + + Map<Artifact, ArtifactDownloadReport> workspaceArtifacts = IvyContext + .getContext().get(WorkspaceResolver.IVYDE_WORKSPACE_ARTIFACT_REPORTS); if (workspaceArtifacts != null) { - // some artifacts were 'forced' by the dependency declaration, whereas they should be - // changed to the eclipse project reference - for (ArtifactDownloadReport artifactReport : report.getArtifactsReports(null, false)) { - ArtifactDownloadReport eclipseArtifactReport = workspaceArtifacts.get(artifactReport.getArtifact()); - if (eclipseArtifactReport == null) { - result.addArtifactReport(artifactReport); - } else { - // let's change - result.addArtifactReport(eclipseArtifactReport); + // some artifact were 'forced' by the dependency declaration, whereas they should be + // switch by the eclipse project reference + for (int i = 0; i < artifactReports.length; i++) { + ArtifactDownloadReport eclipseArtifactReport = (ArtifactDownloadReport) workspaceArtifacts + .get(artifactReports[i].getArtifact()); + if (eclipseArtifactReport != null) { + // let's switch. + artifactReports[i] = eclipseArtifactReport; } } } + result.addArtifactReports(artifactReports); collectArtifactsByDependency(report, result);