Source:
<code>public Artifact resolve(final Artifact artifact, List<ArtifactRepository> remoteRepositories, IProgressMonitor monitor) throws CoreException { if(remoteRepositories == null) { try { remoteRepositories = getArtifactRepositories(); } catch(CoreException e) { remoteRepositories = Collections.emptyList(); } } final List<ArtifactRepository> _remoteRepositories = remoteRepositories; return context().execute(new ICallable<Artifact>() { <START> public Artifact call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException { <END> org.eclipse.aether.RepositorySystem repoSystem = lookup(org.eclipse.aether.RepositorySystem.class); ArtifactRequest request = new ArtifactRequest(); request.setArtifact(RepositoryUtils.toArtifact(artifact)); request.setRepositories(RepositoryUtils.toRepos(_remoteRepositories)); ArtifactResult result; try { result = repoSystem.resolveArtifact(context.getRepositorySession(), request); } catch(ArtifactResolutionException ex) { result = ex.getResults().get(0); } setLastUpdated(context.getLocalRepository(), _remoteRepositories, artifact); if(result.isResolved()) { artifact.selectVersion(result.getArtifact().getVersion()); artifact.setFile(result.getArtifact().getFile()); artifact.setResolved(true); } else { ArrayList<IStatus> members = new ArrayList<IStatus>(); for(Exception e : result.getExceptions()) { if(!(e instanceof ArtifactNotFoundException)) { members.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, e.getMessage(), e)); } } if(members.isEmpty()) { members.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind( Messages.MavenImpl_error_missing, artifact), null)); } IStatus[] newMembers = members.toArray(new IStatus[members.size()]); throw new CoreException(new MultiStatus(IMavenConstants.PLUGIN_ID, -1, newMembers, NLS.bind( Messages.MavenImpl_error_resolve, artifact.toString()), null)); } return artifact; } }, monitor); }</code><technical_language>unnecessary change</technical_language>

Target:
public Artifact resolve(final Artifact artifact, List<ArtifactRepository> remoteRepositories, IProgressMonitor monitor) throws CoreException { if(remoteRepositories == null) { try { remoteRepositories = getArtifactRepositories(); } catch(CoreException e) { remoteRepositories = Collections.emptyList(); } } final List<ArtifactRepository> _remoteRepositories = remoteRepositories; return context().execute((context, pm) -> { org.eclipse.aether.RepositorySystem repoSystem = lookup(org.eclipse.aether.RepositorySystem.class); ArtifactRequest request = new ArtifactRequest(); request.setArtifact(RepositoryUtils.toArtifact(artifact)); request.setRepositories(RepositoryUtils.toRepos(_remoteRepositories)); ArtifactResult result; try { result = repoSystem.resolveArtifact(context.getRepositorySession(), request); } catch(ArtifactResolutionException ex) { result = ex.getResults().get(0); } setLastUpdated(context.getLocalRepository(), _remoteRepositories, artifact); if(result.isResolved()) { artifact.selectVersion(result.getArtifact().getVersion()); artifact.setFile(result.getArtifact().getFile()); artifact.setResolved(true); } else { ArrayList<IStatus> members = new ArrayList<IStatus>(); for(Exception e : result.getExceptions()) { if(!(e instanceof ArtifactNotFoundException)) { members.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, e.getMessage(), e)); } } if(members.isEmpty()) { members.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind( Messages.MavenImpl_error_missing, artifact), null)); } IStatus[] newMembers = members.toArray(new IStatus[members.size()]); throw new CoreException(new MultiStatus(IMavenConstants.PLUGIN_ID, -1, newMembers, NLS.bind( Messages.MavenImpl_error_resolve, artifact.toString()), null)); } return artifact; }, monitor); }