RepositorySystem repositorySystem = getRepositorySystem();
final MavenRepositorySystemSession session = createRepositorSystemSession(offline, repositorySystem);
List<RemoteRepository> repos = getRemoteRepositories();
ArtifactDescriptorResult artifactDescriptorResult = repositorySystem.readArtifactDescriptor(session, new ArtifactDescriptorRequest(root, repos, null));
repos.addAll(artifactDescriptorResult.getRepositories());
Dependency rootDependency = new Dependency(root, null);
List<Dependency> dependencies = artifactDescriptorResult.getDependencies();