Package org.gradle.api.plugins

Examples of org.gradle.api.plugins.PluginInstantiationException


                    pluginClass.getSimpleName()));
        }
        try {
            return pluginClass.newInstance();
        } catch (InstantiationException e) {
            throw new PluginInstantiationException(String.format("Could not create plugin of type '%s'.",
                    pluginClass.getSimpleName()), e.getCause());
        } catch (Exception e) {
            throw new PluginInstantiationException(String.format("Could not create plugin of type '%s'.",
                    pluginClass.getSimpleName()), e);
        }
    }
View Full Code Here


        }

        Properties properties = GUtil.loadProperties(resource);
        String implClassName = properties.getProperty("implementation-class");
        if (!GUtil.isTrue(implClassName)) {
            throw new PluginInstantiationException(String.format(
                    "No implementation class specified for plugin '%s' in %s.", pluginId, resource));
        }

        try {
            implClass = classLoader.loadClass(implClassName).asSubclass(Plugin.class);
        } catch (ClassNotFoundException e) {
            throw new PluginInstantiationException(String.format(
                    "Could not find implementation class '%s' for plugin '%s' specified in %s.", implClass, pluginId,
                    resource), e);
        }

        idMappings.put(pluginId, implClass);
View Full Code Here

                    return Optional.absent();
                }

                String implClassName = pluginDescriptor.getImplementationClassName();
                if (!GUtil.isTrue(implClassName)) {
                    throw new PluginInstantiationException(String.format("No implementation class specified for plugin '%s' in %s.", pluginId, pluginDescriptor));
                }

                Class<?> implClass;
                try {
                    implClass = classLoader.loadClass(implClassName);
View Full Code Here

    private <T extends Plugin<?>> T providePlugin(Class<T> type) {
        try {
            return instantiator.newInstance(type);
        } catch (ObjectInstantiationException e) {
            throw new PluginInstantiationException(String.format("Could not create plugin of type '%s'.", type.getSimpleName()), e.getCause());
        }
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.plugins.PluginInstantiationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.