public PluginVersionResult resolve( PluginVersionRequest request )
throws PluginVersionResolutionException
{
logger.debug( "Resolving plugin version for " + request.getGroupId() + ":" + request.getArtifactId() );
PluginVersionResult result = resolveFromProject( request );
if ( result == null )
{
result = resolveFromRepository( request );
if ( StringUtils.isEmpty( result.getVersion() ) )
{
throw new PluginVersionResolutionException( request.getGroupId(), request.getArtifactId(),
request.getLocalRepository(),
request.getRemoteRepositories(),
"Plugin not found in any plugin repository" );
}
else if ( logger.isDebugEnabled() )
{
logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId()
+ " to " + result.getVersion() + " from repository "
+ ( result.getRepository() != null ? result.getRepository().getId() : "null" ) );
}
}
else if ( logger.isDebugEnabled() )
{
logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId()
+ " to " + result.getVersion() + " from POM " + request.getPom() );
}
return result;
}