@Override
public File resolve(final MavenProject project, final String artifact) {
final ArtifactResult result;
try {
final ProjectBuildingRequest projectBuildingRequest = invoke(project, "getProjectBuildingRequest", ProjectBuildingRequest.class);
final ArtifactRequest request = new ArtifactRequest();
final DefaultArtifact defaultArtifact = createArtifact(artifact);
request.setArtifact(defaultArtifact);
@SuppressWarnings("unchecked")
final List<RemoteRepository> repos = invoke(project, "getRemoteProjectRepositories", List.class);
request.setRepositories(repos);
result = repoSystem.resolveArtifact(projectBuildingRequest.getRepositorySession(), request);
} catch (ArtifactResolutionException e) {
throw new RuntimeException(e.getMessage(), e);
} catch (NoSuchMethodException e) {
throw new RuntimeException(e.getMessage(), e);