diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index d56f503..4086979 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -168,7 +168,7 @@ public function registerBundles() {
       $module_list = $this->configStorage->read('system.module');
       $this->moduleList = isset($module_list['enabled']) ? $module_list['enabled'] : array();
     }
-    $this->registerModuleNamespaces($this->getModuleFileNames());
+    $this->registerNamespaces($this->getModuleNamespaces($this->getModuleFileNames()));
 
     // Load each module's bundle class.
     foreach ($this->moduleList as $module => $weight) {
@@ -295,7 +295,7 @@ protected function initializeContainer() {
       // from the container.
       $container_modules = $this->container->getParameter('container.modules');
       $namespaces_before = $this->classLoader->getNamespaces();
-      $this->registerModuleNamespaces($container_modules);
+      $this->registerNamespaces($this->getModuleNamespaces($container_modules));
 
       // If 'container.modules' is wrong, the container must be rebuilt.
       if (!isset($this->moduleList)) {
@@ -368,6 +368,11 @@ protected function buildContainer() {
     $container = $this->getContainerBuilder();
     $container->setParameter('container.bundles', $this->bundleClasses);
     $container->setParameter('container.modules', $this->getModuleFileNames());
+
+    // Get a list of namespaces with potential plugin namespaces.
+    $namespaces = $this->getModuleNamespaces($this->getModuleFileNames());
+    $container->setParameter('plugin.namespaces', $namespaces);
+
     // Register synthetic services.
     $container->register('class_loader', 'Symfony\Component\ClassLoader\UniversalClassLoader')->setSynthetic(TRUE);
     $container->register('kernel', 'Symfony\Component\HttpKernel\KernelInterface')->setSynthetic(TRUE);
@@ -453,11 +458,22 @@ protected function getModuleFileNames() {
   }
 
   /**
-   * Registers the namespace of each enabled module with the class loader.
+   * Gets the namespaces of each enabled module.
    */
-  protected function registerModuleNamespaces($moduleFileNames) {
+  protected function getModuleNamespaces($moduleFileNames) {
+    $namespaces = array();
     foreach ($moduleFileNames as $module => $filename) {
-      $this->classLoader->registerNamespace("Drupal\\$module", DRUPAL_ROOT . '/' . dirname($filename) . '/lib');
+      $namespaces["Drupal\\$module"] = DRUPAL_ROOT . '/' . dirname($filename) . '/lib';
+    }
+    return $namespaces;
+  }
+
+  /**
+   * Registers a list of namespaces.
+   */
+  protected function registerNamespaces(array $namespaces = array()) {
+    foreach ($namespaces as $namespace => $dir) {
+      $this->classLoader->registerNamespace($namespace, $dir);
     }
   }
 }
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
index 0b387dc..15e63bc 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
@@ -16,11 +16,15 @@ class AnnotatedClassDiscovery extends ComponentAnnotatedClassDiscovery {
 
   /**
    * Constructs an AnnotatedClassDiscovery object.
+   *
+   * @param array $plugin_namespaces
+   *   An array of paths keyed by it's corresponding namespaces.
    */
-  function __construct($owner, $type, $root_namespaces = NULL) {
+  function __construct($owner, $type, $root_namespaces = NULL, $plugin_namespaces = array()) {
     $this->owner = $owner;
     $this->type = $type;
     $this->rootNamespaces = $root_namespaces;
+    $this->pluginNamespaces = $plugin_namespaces;
     $annotation_namespaces = array(
       'Drupal\Component\Annotation' => DRUPAL_ROOT . '/core/lib',
       'Drupal\Core\Annotation' => DRUPAL_ROOT . '/core/lib',
@@ -36,6 +40,9 @@ function __construct($owner, $type, $root_namespaces = NULL) {
    * lifetime of a plugin manager.
    */
   protected function getPluginNamespaces() {
+    if (!empty($plugin_namespaces)) {
+      return parent::getPluginNamespaces();
+    }
     $plugin_namespaces = array();
     $root_namespaces = isset($this->rootNamespaces) ? $this->rootNamespaces : drupal_classloader()->getNamespaces();
     foreach ($root_namespaces as $namespace => $dirs) {
diff --git a/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php b/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php
index 14fc64a..4786ce0 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php
@@ -22,9 +22,14 @@ class ViewsPluginManager extends PluginManagerBase {
 
   /**
    * Constructs a ViewsPluginManager object.
+   *
+   * @param string $type
+   *   The plugin type, for example filter.
+   * @param array $plugin_namespaces
+   *   An array of paths keyed by it's corresponding namespaces.
    */
-  public function __construct($type) {
-    $this->discovery = new AnnotatedClassDiscovery('views', $type);
+  public function __construct($type, array $plugin_namespaces = array()) {
+    $this->discovery = new AnnotatedClassDiscovery('views', $type, NULL, $plugin_namespaces);
     $this->discovery = new DerivativeDiscoveryDecorator($this->discovery);
     $this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition'));
     $this->discovery = new AlterDecorator($this->discovery, 'views_plugins_' . $type);
diff --git a/core/modules/views/lib/Drupal/views/ViewsBundle.php b/core/modules/views/lib/Drupal/views/ViewsBundle.php
index dfb6dd6..7d41c5e 100644
--- a/core/modules/views/lib/Drupal/views/ViewsBundle.php
+++ b/core/modules/views/lib/Drupal/views/ViewsBundle.php
@@ -23,7 +23,8 @@ class ViewsBundle extends Bundle {
   public function build(ContainerBuilder $container) {
     foreach (ViewExecutable::getPluginTypes() as $type) {
       $container->register("plugin.manager.views.$type", 'Drupal\views\Plugin\ViewsPluginManager')
-        ->addArgument($type);
+        ->addArgument($type)
+        ->addArgument('%plugin.namespaces%');
     }
 
     $container
