VersionRangeResult versionRangeResult =
versionRangeResolver.resolveVersionRange( session, versionRangeRequest );
if ( versionRangeResult.getHighestVersion() == null )
{
throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion()
+ "'", parent.getGroupId(), parent.getArtifactId(),
parent.getVersion() );
}
if ( versionRangeResult.getVersionConstraint() != null
&& versionRangeResult.getVersionConstraint().getRange() != null
&& versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null )
{
throw new UnresolvableModelException( "The requested version range '" + parent.getVersion()
+ "' does not specify an upper bound", parent.getGroupId(),
parent.getArtifactId(), parent.getVersion() );
}
parent.setVersion( versionRangeResult.getHighestVersion().toString() );
}
catch ( VersionRangeResolutionException e )
{
throw new UnresolvableModelException( e.getMessage(), parent.getGroupId(), parent.getArtifactId(),
parent.getVersion(), e );
}
return resolveModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );