Artifact artifact = dependencyToMavenArtifact(currentVersion);
if (ar instanceof LocalRepository)
{
LocalArtifactRequest request = new LocalArtifactRequest(artifact, null, null);
LocalArtifactResult a = session.getLocalRepositoryManager().find(session, request);
File file = a.getFile();
DependencyResource resource = new DependencyResource(factory, file, currentVersion);
if (!result.contains(resource))
{
result.add(resource);
continue VERSION;
}
}
if (ar instanceof RemoteRepository)
{
ArtifactRequest request = new ArtifactRequest();
RemoteRepository remoteRepo = new RemoteRepository(ar.getId(), ar.getContentType(),
((RemoteRepository) ar).getUrl());
request.addRepository(remoteRepo);
request.setArtifact(artifact);
try
{
ArtifactResult a = system.resolveArtifact(session, request);
File file = a.getArtifact().getFile();
DependencyResource resource = new DependencyResource(factory, file, currentVersion);
if (!result.contains(resource))
{
result.add(resource);
continue VERSION;