diff --git a/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php
index 377bf4a..715bbfe 100644
--- a/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php
+++ b/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php
@@ -84,6 +84,8 @@ public function getDefinitions() {
 
     // Search for classes within all PSR-0 namespace locations.
     foreach ($this->getPluginNamespaces() as $namespace => $dirs) {
+      // Extract the module name from this namespace.
+      $module = $this->getModuleFromNamespace($namespace);
       foreach ($dirs as $dir) {
         $dir .= DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $namespace);
         if (file_exists($dir)) {
@@ -103,6 +105,7 @@ public function getDefinitions() {
                 // instead of requiring us to work with the annotation object.
                 $definition = $annotation->get();
                 $definition['class'] = $class;
+                $definition['module'] = $module;
                 $definitions[$definition['id']] = $definition;
               }
             }
@@ -114,6 +117,25 @@ public function getDefinitions() {
   }
 
   /**
+   * Extracts a module name from a Drupal namespace.
+   *
+   * @param string $namespace
+   *   The namespace to extract the module name from.
+   *
+   * @return string|null
+   *   The matches module name, or NULL otherwise.
+   */
+  protected function getModuleFromNamespace($namespace) {
+    preg_match('|^Drupal\\\\(?<module>[\w]+)\\\\|', $namespace, $matches);
+
+    if (isset($matches['module'])) {
+      return $matches['module'];
+    }
+
+    return NULL;
+  }
+
+  /**
    * Returns an array of PSR-0 namespaces to search for plugin classes.
    */
   protected function getPluginNamespaces() {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
index 0071f70..fb44b29 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
@@ -30,6 +30,7 @@ public function setUp() {
         'label' => 'Apple',
         'color' => 'green',
         'class' => 'Drupal\plugin_test\Plugin\plugin_test\fruit\Apple',
+        'module' => 'plugin_test',
       ),
       'banana' => array(
         'id' => 'banana',
@@ -39,18 +40,21 @@ public function setUp() {
           'bread' => t('Banana bread'),
         ),
         'class' => 'Drupal\plugin_test\Plugin\plugin_test\fruit\Banana',
+        'module' => 'plugin_test',
       ),
       'cherry' => array(
         'id' => 'cherry',
         'label' => 'Cherry',
         'color' => 'red',
         'class' => 'Drupal\plugin_test\Plugin\plugin_test\fruit\Cherry',
+        'module' => 'plugin_test',
       ),
       'orange' => array(
         'id' => 'orange',
         'label' => 'Orange',
         'color' => 'orange',
         'class' => 'Drupal\plugin_test\Plugin\plugin_test\fruit\Orange',
+        'module' => 'plugin_test',
       ),
     );
     $namespaces = new \ArrayObject(array('Drupal\plugin_test' => DRUPAL_ROOT . '/core/modules/system/tests/modules/plugin_test/lib'));
diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
index 5ed2c5e..6b9bdef 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
@@ -32,11 +32,13 @@ protected function setUp() {
         'id' => 'example_1',
         'custom' => 'John',
         'class' => 'Drupal\plugin_test\Plugin\plugin_test\custom_annotation\Example1',
+        'module' => 'plugin_test',
       ),
       'example_2' => array(
         'id' => 'example_2',
         'custom' => 'Paul',
         'class' => 'Drupal\plugin_test\Plugin\plugin_test\custom_annotation\Example2',
+        'module' => 'plugin_test',
       ),
     );
     $root_namespaces = new \ArrayObject(array('Drupal\plugin_test' => DRUPAL_ROOT . '/core/modules/system/tests/modules/plugin_test/lib'));
