Search in sources :

Example 1 with UnknownPluginException

use of org.gradle.api.plugins.UnknownPluginException in project gradle by gradle.

the class DefaultPluginRequestApplicator method resolveToFoundResult.

private Result resolveToFoundResult(PluginResolver effectivePluginResolver, PluginRequestInternal request) {
    Result result = new Result(request);
    try {
        effectivePluginResolver.resolve(request, result);
    } catch (Exception e) {
        throw new LocationAwareException(new GradleException(String.format("Error resolving plugin %s", request.getDisplayName()), e), request.getScriptDisplayName(), request.getLineNumber());
    }
    if (!result.isFound()) {
        String message = buildNotFoundMessage(request, result);
        Exception exception = new UnknownPluginException(message);
        throw new LocationAwareException(exception, request.getScriptDisplayName(), request.getLineNumber());
    }
    return result;
}
Also used : LocationAwareException(org.gradle.internal.exceptions.LocationAwareException) GradleException(org.gradle.api.GradleException) UnknownPluginException(org.gradle.api.plugins.UnknownPluginException) InvalidUserCodeException(org.gradle.api.InvalidUserCodeException) GradleException(org.gradle.api.GradleException) UnknownPluginException(org.gradle.api.plugins.UnknownPluginException) LocationAwareException(org.gradle.internal.exceptions.LocationAwareException) InvalidPluginException(org.gradle.api.plugins.InvalidPluginException) PluginResolutionResult(org.gradle.plugin.use.resolve.internal.PluginResolutionResult)

Example 2 with UnknownPluginException

use of org.gradle.api.plugins.UnknownPluginException in project gradle by gradle.

the class ClassPathPluginResolution method execute.

@Override
public void execute(PluginResolveContext pluginResolveContext) {
    PluginRegistry pluginRegistry = new DefaultPluginRegistry(pluginInspector, parent);
    PluginImplementation<?> plugin = pluginRegistry.lookup(pluginId);
    if (plugin == null) {
        throw new UnknownPluginException("Plugin with id '" + pluginId + "' not found.");
    }
    pluginResolveContext.add(plugin);
}
Also used : DefaultPluginRegistry(org.gradle.api.internal.plugins.DefaultPluginRegistry) PluginRegistry(org.gradle.api.internal.plugins.PluginRegistry) DefaultPluginRegistry(org.gradle.api.internal.plugins.DefaultPluginRegistry) UnknownPluginException(org.gradle.api.plugins.UnknownPluginException)

Aggregations

UnknownPluginException (org.gradle.api.plugins.UnknownPluginException)2 GradleException (org.gradle.api.GradleException)1 InvalidUserCodeException (org.gradle.api.InvalidUserCodeException)1 DefaultPluginRegistry (org.gradle.api.internal.plugins.DefaultPluginRegistry)1 PluginRegistry (org.gradle.api.internal.plugins.PluginRegistry)1 InvalidPluginException (org.gradle.api.plugins.InvalidPluginException)1 LocationAwareException (org.gradle.internal.exceptions.LocationAwareException)1 PluginResolutionResult (org.gradle.plugin.use.resolve.internal.PluginResolutionResult)1