for ( Artifact artifact = request.getArtifact();; )
{
Artifact pomArtifact = ArtifactDescriptorUtils.toPomArtifact( artifact );
try
{
VersionRequest versionRequest =
new VersionRequest( artifact, request.getRepositories(), request.getRequestContext() );
versionRequest.setTrace( trace );
VersionResult versionResult = versionResolver.resolveVersion( session, versionRequest );
artifact = artifact.setVersion( versionResult.getVersion() );
versionRequest =
new VersionRequest( pomArtifact, request.getRepositories(), request.getRequestContext() );
versionRequest.setTrace( trace );
versionResult = versionResolver.resolveVersion( session, versionRequest );
pomArtifact = pomArtifact.setVersion( versionResult.getVersion() );
}
catch ( VersionResolutionException e )