.setRemoteRepositories(new ArrayList<>(remoteRepositories))
.setArtifact(artifact);
ArtifactResolutionResult result = repositorySystem.resolve(request);
for (Artifact resolvedArtifact : result.getArtifacts()) {
if (resolvedArtifact.getFile() != null) {
providers.add(new JarSourceFileProvider(resolvedArtifact.getFile()));
}
}
}
for (String sourceRoot : mavenProject.getCompileSourceRoots()) {
providers.add(new DirectorySourceFileProvider(new File(sourceRoot)));