diff --git a/src/libs/extensionsystem/iplugin.h b/src/libs/extensionsystem/iplugin.h
index 37f474a09ce4089fc119d9740ebf9724e8535b77..598eef9aab4f4a498372353926d6186274c03272 100644
--- a/src/libs/extensionsystem/iplugin.h
+++ b/src/libs/extensionsystem/iplugin.h
@@ -36,6 +36,9 @@
 #include "extensionsystem_global.h"
 
 #include <QObject>
+#if QT_VERSION >= 0x050000
+#    include <QtPlugin>
+#endif
 
 namespace ExtensionSystem {
 
@@ -83,4 +86,16 @@ private:
 
 } // namespace ExtensionSystem
 
+// The macros Q_EXPORT_PLUGIN, Q_EXPORT_PLUGIN2 become obsolete in Qt 5.
+#if QT_VERSION >= 0x050000
+#    if defined(Q_EXPORT_PLUGIN)
+#        undef Q_EXPORT_PLUGIN
+#        undef Q_EXPORT_PLUGIN2
+#    endif
+#    define Q_EXPORT_PLUGIN(plugin)
+#    define Q_EXPORT_PLUGIN2(function, plugin)
+#else
+#    define Q_PLUGIN_METADATA(x)
+#endif
+
 #endif // IPLUGIN_H
diff --git a/src/libs/qtcomponents/styleitem/qstyleplugin.cpp b/src/libs/qtcomponents/styleitem/qstyleplugin.cpp
index d615bd4a2f4c545b6264e68d96724a50cbe9d0ac..4eb4427ff3bf460b56c794e685c715716b7294f5 100644
--- a/src/libs/qtcomponents/styleitem/qstyleplugin.cpp
+++ b/src/libs/qtcomponents/styleitem/qstyleplugin.cpp
@@ -95,4 +95,6 @@ void StylePlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
     engine->addImageProvider("desktoptheme", new DesktopIconProvider);
 }
 
+#if QT_VERSION < 0x050000
 Q_EXPORT_PLUGIN2(styleplugin, StylePlugin)
+#endif
diff --git a/src/libs/qtcomponents/styleitem/qstyleplugin.h b/src/libs/qtcomponents/styleitem/qstyleplugin.h
index 74cf097a2e74aaaaf9c8442eeda4dfcac23d9c30..c10d5a5e02358021e52d1788287cd73bafad6da7 100644
--- a/src/libs/qtcomponents/styleitem/qstyleplugin.h
+++ b/src/libs/qtcomponents/styleitem/qstyleplugin.h
@@ -50,6 +50,11 @@
 class StylePlugin : public QDeclarativeExtensionPlugin
 {
     Q_OBJECT
+#if QT_VERSION >= 0x050000
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "styleitem.json")
+    Q_INTERFACES(QDeclarativeExtensionInterface)
+#endif
+
 public:
     void registerTypes(const char *uri);
     void initializeEngine(QDeclarativeEngine *engine, const char *uri);
diff --git a/src/libs/qtcomponents/styleitem/styleitem.json b/src/libs/qtcomponents/styleitem/styleitem.json
new file mode 100644
index 0000000000000000000000000000000000000000..0967ef424bce6791893e9a57bb952f80fd536e93
--- /dev/null
+++ b/src/libs/qtcomponents/styleitem/styleitem.json
@@ -0,0 +1 @@
+{}
diff --git a/src/pluginjsonmetadata.xsl b/src/pluginjsonmetadata.xsl
new file mode 100644
index 0000000000000000000000000000000000000000..dff00332b72873a75908effd59f94892cdec1928
--- /dev/null
+++ b/src/pluginjsonmetadata.xsl
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!-- XSL sheet to transform Qt Creator's pluginspec files into json files required
+     for the new Qt 5 plugin system. -->
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:strip-space elements="plugin vendor category description url"/>
+<xsl:template match="/">
+{
+    <xsl:apply-templates/>
+}
+</xsl:template>
+<xsl:template match="license"/>
+<xsl:template match="dependencyList"/>
+<xsl:template match="copyright"/>
+<xsl:template match="argumentList"/>
+<xsl:template match="vendor">
+"Vendor" : "<xsl:apply-templates/>",
+</xsl:template>
+<xsl:template match="category">
+"Category" : "<xsl:apply-templates/>",
+</xsl:template>
+<xsl:template match="description">
+"Description" : "<xsl:apply-templates/>",
+</xsl:template>
+<xsl:template match="url">
+"Url" : "<xsl:apply-templates/>"
+</xsl:template>
+</xsl:stylesheet>
diff --git a/src/plugins/analyzerbase/analyzerplugin.h b/src/plugins/analyzerbase/analyzerplugin.h
index 7db7c8c2064bac0dea1013e91af5d16d73b728f1..da5d80588ce10cadd68afe61f847ea7239c6c4e2 100644
--- a/src/plugins/analyzerbase/analyzerplugin.h
+++ b/src/plugins/analyzerbase/analyzerplugin.h
@@ -43,6 +43,7 @@ namespace Internal {
 class AnalyzerPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AnalyzerBase.json")
 
 public:
     static AnalyzerPlugin *instance();
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h
index e7210d0ac32e376ab9afa39e84dc554baa0118f2..2e46de174678a790d9c01a5b27076affb7f17851 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h
+++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h
@@ -70,6 +70,9 @@ namespace Internal {
 
 class AutotoolsProjectPlugin : public ExtensionSystem::IPlugin
 {
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AutotoolsProjectManager.json")
+
 public:
     AutotoolsProjectPlugin();
 
diff --git a/src/plugins/bazaar/bazaarplugin.h b/src/plugins/bazaar/bazaarplugin.h
index dff761197784f899e452926cf365e36c46e14b9b..f64372c814dadfbeb6c33f0a87f5f934e6a99cef 100644
--- a/src/plugins/bazaar/bazaarplugin.h
+++ b/src/plugins/bazaar/bazaarplugin.h
@@ -81,6 +81,7 @@ class BazaarEditor;
 class BazaarPlugin : public VcsBase::VcsBasePlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Bazaar.json")
 
 public:
     BazaarPlugin();
diff --git a/src/plugins/bineditor/bineditorplugin.h b/src/plugins/bineditor/bineditorplugin.h
index 2db7c380010f2ca828c004c88b15e2bbeda5244d..b4fd4050892629c8188dd6ab0b01a8e5859e0de8 100644
--- a/src/plugins/bineditor/bineditorplugin.h
+++ b/src/plugins/bineditor/bineditorplugin.h
@@ -60,6 +60,7 @@ class BinEditorFactory;
 class BinEditorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "BinEditor.json")
 
 public:
     BinEditorPlugin();
diff --git a/src/plugins/bookmarks/bookmarksplugin.h b/src/plugins/bookmarks/bookmarksplugin.h
index 2607ebcb21372e315d1fd20bcfa6ebbd40677c39..7f03ce93b8a7feea66926f95d3976548324f69dd 100644
--- a/src/plugins/bookmarks/bookmarksplugin.h
+++ b/src/plugins/bookmarks/bookmarksplugin.h
@@ -59,6 +59,7 @@ class BookmarkManager;
 class BookmarksPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Bookmarks.json")
 
 public:
     BookmarksPlugin();
diff --git a/src/plugins/classview/classviewplugin.h b/src/plugins/classview/classviewplugin.h
index 912856b064fb7b6bc193a5c47a00e180f1d65005..3a0f8d455a4c429ea5f3b47fddd7d63bc9ff11e3 100644
--- a/src/plugins/classview/classviewplugin.h
+++ b/src/plugins/classview/classviewplugin.h
@@ -46,6 +46,7 @@ namespace Internal {
 class Plugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ClassView.json")
 
 public:
     //! Constructor
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h
index 913f1b2ced6e587edf8358248a2df5d83d7779a3..f876807d595181ab45aa9c5af68d6ddbaace1b8f 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h
@@ -44,6 +44,7 @@ class CMakeProjectPlugin
   : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CMakeProjectManager.json")
 
 public:
     CMakeProjectPlugin();
diff --git a/src/plugins/coreplugin/coreplugin.h b/src/plugins/coreplugin/coreplugin.h
index 947abf800f61766b2c3f693417b66b186680ff1e..e8a444b3e5e4db01a209934ff3181a340cd214f3 100644
--- a/src/plugins/coreplugin/coreplugin.h
+++ b/src/plugins/coreplugin/coreplugin.h
@@ -45,6 +45,7 @@ class MainWindow;
 class CorePlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Core.json")
 
 public:
     CorePlugin();
diff --git a/src/plugins/cpaster/cpasterplugin.h b/src/plugins/cpaster/cpasterplugin.h
index 4b50faa91cecb815dcc133ec87a45a49d93f120b..f7c93526b533bac1db5f38671fa33702dfe31616 100644
--- a/src/plugins/cpaster/cpasterplugin.h
+++ b/src/plugins/cpaster/cpasterplugin.h
@@ -63,6 +63,7 @@ public slots:
 class CodepasterPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CodePaster.json")
 
 public:
     CodepasterPlugin();
diff --git a/src/plugins/cppeditor/cppplugin.h b/src/plugins/cppeditor/cppplugin.h
index acc251e5cb82692f28011bd323fe2e265445ed65..3b42b0b28b216d8deb0cd3d1e3fca9e767d6a0b8 100644
--- a/src/plugins/cppeditor/cppplugin.h
+++ b/src/plugins/cppeditor/cppplugin.h
@@ -55,6 +55,7 @@ class CppQuickFixAssistProvider;
 class CppPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CppEditor.json")
 
 public:
     CppPlugin();
diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h
index 51319ffc965ea245678ab62374e3e6c599f777ba..b4b167b9a1a65073e6d9be5de57d46958faf4e24 100644
--- a/src/plugins/cpptools/cpptoolsplugin.h
+++ b/src/plugins/cpptools/cpptoolsplugin.h
@@ -63,6 +63,7 @@ struct CppFileSettings;
 class CppToolsPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CppTools.json")
 
 public:
     CppToolsPlugin();
diff --git a/src/plugins/cvs/cvsplugin.h b/src/plugins/cvs/cvsplugin.h
index f95caff99c1d5734cb5ac63e7e1fe056e84c16bd..6f077e61a1a9f0102ecdf45b7ec3e42f8946902d 100644
--- a/src/plugins/cvs/cvsplugin.h
+++ b/src/plugins/cvs/cvsplugin.h
@@ -74,6 +74,7 @@ struct CvsResponse
 class CvsPlugin : public VcsBase::VcsBasePlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CVS.json")
 
 public:
     CvsPlugin();
diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h
index c18f93bbe900bf9dc504fa7c99ab662564247860..485045957299bbbaabe5bdf2ee2b22d99b61a0a4 100644
--- a/src/plugins/debugger/debuggerplugin.h
+++ b/src/plugins/debugger/debuggerplugin.h
@@ -53,6 +53,7 @@ class DebuggerStartParameters;
 class DEBUGGER_EXPORT DebuggerPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Debugger.json")
 
 public:
     DebuggerPlugin();
diff --git a/src/plugins/designer/formeditorplugin.h b/src/plugins/designer/formeditorplugin.h
index a6a9bab9597f269dae75082f869246c38accbf28..6d11abeb037b7bef2f461f655d70e0b465f25914 100644
--- a/src/plugins/designer/formeditorplugin.h
+++ b/src/plugins/designer/formeditorplugin.h
@@ -41,6 +41,7 @@ namespace Internal {
 class FormEditorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Designer.json")
 
 public:
     FormEditorPlugin();
diff --git a/src/plugins/fakevim/fakevimplugin.h b/src/plugins/fakevim/fakevimplugin.h
index 88f60f619c20e2c472d2dc9950f622b91d0e2224..c7dba08b426f3d11a950a98061c5d0cc9b00ae64 100644
--- a/src/plugins/fakevim/fakevimplugin.h
+++ b/src/plugins/fakevim/fakevimplugin.h
@@ -44,6 +44,7 @@ class FakeVimPluginPrivate;
 class FakeVimPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "FakeVim.json")
 
 public:
     FakeVimPlugin();
diff --git a/src/plugins/find/findplugin.h b/src/plugins/find/findplugin.h
index f5862087dbffa3f782580f0f8554ec2e3a12fdfe..9a34b9a3c9d5ca1d9bc1d6f53e4998b36e5b8ad5 100644
--- a/src/plugins/find/findplugin.h
+++ b/src/plugins/find/findplugin.h
@@ -54,6 +54,7 @@ class CurrentDocumentFind;
 class FIND_EXPORT FindPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Find.json")
 
 public:
     FindPlugin();
diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.h b/src/plugins/genericprojectmanager/genericprojectplugin.h
index 277d219d55f2295f3d8bb17ecdd99d64a03983cc..29b1477fa91631d292949342829901d99171638d 100644
--- a/src/plugins/genericprojectmanager/genericprojectplugin.h
+++ b/src/plugins/genericprojectmanager/genericprojectplugin.h
@@ -51,6 +51,7 @@ class ProjectFilesFactory;
 class GenericProjectPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "GenericProjectManager.json")
 
 public:
     GenericProjectPlugin();
diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h
index e8c3d15f0ca87ee0f7895edc9aa246f1cc51a8a5..75bab4fc58d4e90bc752ed86bec45279f93ed497 100644
--- a/src/plugins/git/gitplugin.h
+++ b/src/plugins/git/gitplugin.h
@@ -86,6 +86,7 @@ typedef QPair<Utils::ParameterAction *, Core::Command* > ParameterActionCommandP
 class GitPlugin : public VcsBase::VcsBasePlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Git.json")
 
 public:
     GitPlugin();
diff --git a/src/plugins/glsleditor/glsleditorplugin.h b/src/plugins/glsleditor/glsleditorplugin.h
index 4951cdeb46bd31b62ebd72a928ac827d8fb1a6ea..37e892b4726d355979dc7e98eb009615b5c91264 100644
--- a/src/plugins/glsleditor/glsleditorplugin.h
+++ b/src/plugins/glsleditor/glsleditorplugin.h
@@ -73,6 +73,7 @@ class GLSLQuickFixCollector;
 class GLSLEditorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "GLSLEditor.json")
 
 public:
     GLSLEditorPlugin();
diff --git a/src/plugins/helloworld/helloworldplugin.h b/src/plugins/helloworld/helloworldplugin.h
index 3e0852ca651c2a4493e7fac32a7c67a2eabe6209..0702513b256feb1986380a476e202992c83fa8d1 100644
--- a/src/plugins/helloworld/helloworldplugin.h
+++ b/src/plugins/helloworld/helloworldplugin.h
@@ -42,6 +42,7 @@ class HelloWorldPlugin
   : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "HelloWorld.json")
 
 public:
     HelloWorldPlugin();
diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h
index 17c01383188b7421a1f3304ce81a0fd0f36525af..4a0b10df123b251efaf8bedbddacc1bf622697d9 100644
--- a/src/plugins/help/helpplugin.h
+++ b/src/plugins/help/helpplugin.h
@@ -70,6 +70,7 @@ class SearchWidget;
 class HelpPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Help.json")
 
 public:
     HelpPlugin();
diff --git a/src/plugins/imageviewer/imageviewerplugin.h b/src/plugins/imageviewer/imageviewerplugin.h
index 66aba081575e5c5fe211e97d6f2786c481a34ac1..c077f7b767e623c948f536023f60159fbc99ccdd 100644
--- a/src/plugins/imageviewer/imageviewerplugin.h
+++ b/src/plugins/imageviewer/imageviewerplugin.h
@@ -46,6 +46,7 @@ class ImageViewerFactory;
 class ImageViewerPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ImageViewer.json")
 
 public:
     ImageViewerPlugin();
diff --git a/src/plugins/locator/locatorplugin.h b/src/plugins/locator/locatorplugin.h
index 8c5a56a9e7e6ed6f3edeea16f358e6fc9d31f496..99913c1bfa88babdaa262cea2fee75ade53c1d18 100644
--- a/src/plugins/locator/locatorplugin.h
+++ b/src/plugins/locator/locatorplugin.h
@@ -44,6 +44,10 @@
 #include <QTimer>
 #include <QFutureWatcher>
 
+#if QT_VERSION >= 0x050000
+#    include <QtPlugin>
+#endif
+
 namespace Locator {
 namespace Internal {
 
@@ -56,6 +60,7 @@ class LocatorPlugin;
 class LocatorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Locator.json")
 
 public:
     LocatorPlugin();
diff --git a/src/plugins/macros/macrosplugin.h b/src/plugins/macros/macrosplugin.h
index f434508480bef402fc930d9a6737bf172f2c90f5..39c854768696a21b690caaeca6e9cc6fe6752607 100644
--- a/src/plugins/macros/macrosplugin.h
+++ b/src/plugins/macros/macrosplugin.h
@@ -44,6 +44,7 @@ namespace Internal {
 class MacrosPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Macros.json")
 
 public:
     MacrosPlugin();
diff --git a/src/plugins/madde/maddeplugin.h b/src/plugins/madde/maddeplugin.h
index 1d686023424dd231b5d3a97a39a6cf17ddec1d8b..60930b83c5a396ac033309dbb11d956b4132e974 100644
--- a/src/plugins/madde/maddeplugin.h
+++ b/src/plugins/madde/maddeplugin.h
@@ -41,6 +41,8 @@ namespace Internal {
 class MaddePlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Madde.json")
+
 public:
     MaddePlugin();
     ~MaddePlugin();
diff --git a/src/plugins/mercurial/mercurialplugin.h b/src/plugins/mercurial/mercurialplugin.h
index f020d67244642c2953a39aa63f19daf3a7b94204..17596be5f3532d958f08e9c2e2faa6af602fc2c1 100644
--- a/src/plugins/mercurial/mercurialplugin.h
+++ b/src/plugins/mercurial/mercurialplugin.h
@@ -68,6 +68,7 @@ class MercurialSettings;
 class MercurialPlugin : public VcsBase::VcsBasePlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Mercurial.json")
 
 public:
     MercurialPlugin();
diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h
index 1c2f7ed36cf555d7710e4ed47b8fc7c658f2e249..51ae8cc2bd36fe0042cb7a509e0fd7468b44ef76 100644
--- a/src/plugins/perforce/perforceplugin.h
+++ b/src/plugins/perforce/perforceplugin.h
@@ -80,6 +80,7 @@ struct PerforceResponse
 class PerforcePlugin : public VcsBase::VcsBasePlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Perforce.json")
 
 public:
     PerforcePlugin();
diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h
index 49145de8f21ace7aaeff60246295a5f2e3b41bca..c111150cb1a9873cc4b233a03913c5169e815124 100644
--- a/src/plugins/projectexplorer/projectexplorer.h
+++ b/src/plugins/projectexplorer/projectexplorer.h
@@ -72,6 +72,7 @@ class PROJECTEXPLORER_EXPORT ProjectExplorerPlugin
     : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ProjectExplorer.json")
 
 public:
     ProjectExplorerPlugin();
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.h b/src/plugins/qmldesigner/qmldesignerplugin.h
index ec5cbb9af311aba0c26212ecabf186c689f596a7..87d192e24a80bd30ac38b5dab85c2616b94ea8a4 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.h
+++ b/src/plugins/qmldesigner/qmldesignerplugin.h
@@ -65,6 +65,7 @@ class DesignModeContext;
 class BauhausPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlDesigner.json")
 
 public:
     BauhausPlugin();
diff --git a/src/plugins/qmljseditor/qmljseditorplugin.h b/src/plugins/qmljseditor/qmljseditorplugin.h
index 1633f0fd84bf489322775a1d877f5edcf6f39547..daafed94232caad9c23ffb7d7225ba60ab8c13fc 100644
--- a/src/plugins/qmljseditor/qmljseditorplugin.h
+++ b/src/plugins/qmljseditor/qmljseditorplugin.h
@@ -79,6 +79,7 @@ class QmlTaskManager;
 class QmlJSEditorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlJSEditor.json")
 
 public:
     QmlJSEditorPlugin();
diff --git a/src/plugins/qmljsinspector/qmljsinspectorplugin.h b/src/plugins/qmljsinspector/qmljsinspectorplugin.h
index 34bedf6d659b05950ab2be4d4ae347cb7cd8cbb6..d3322121fdaf976c95d2e024c656a18666d4253f 100644
--- a/src/plugins/qmljsinspector/qmljsinspectorplugin.h
+++ b/src/plugins/qmljsinspector/qmljsinspectorplugin.h
@@ -52,6 +52,7 @@ class InspectorUi;
 class InspectorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlJSInspector.json")
 
 public:
     InspectorPlugin();
diff --git a/src/plugins/qmljstools/qmljstoolsplugin.h b/src/plugins/qmljstools/qmljstoolsplugin.h
index f35917fd4d82a57f2e9735a5885df6b3577a95c2..54b8837a37dec51206a03d8d319182741c8ea020 100644
--- a/src/plugins/qmljstools/qmljstoolsplugin.h
+++ b/src/plugins/qmljstools/qmljstoolsplugin.h
@@ -56,6 +56,7 @@ class ModelManager;
 class QmlJSToolsPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlJSTools.json")
 
 public:
     static QmlJSToolsPlugin *instance() { return m_instance; }
diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.h b/src/plugins/qmlprofiler/qmlprofilerplugin.h
index 624d2a6988053610ed103e25d59ac472ceb3fd32..6e0512e2e08dfb8300f9630e4db3a2977186f57a 100644
--- a/src/plugins/qmlprofiler/qmlprofilerplugin.h
+++ b/src/plugins/qmlprofiler/qmlprofilerplugin.h
@@ -43,6 +43,7 @@ namespace Internal {
 class QmlProfilerPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProfiler.json")
 
 public:
     QmlProfilerPlugin() {}
diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.h b/src/plugins/qmlprojectmanager/qmlprojectplugin.h
index 224c572aac64319e3f4ab6ef9e8da116a7fd0006..c9b10b7fe798181b3535215a80f5985562c71583 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectplugin.h
+++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.h
@@ -42,6 +42,7 @@ namespace QmlProjectManager {
 class QMLPROJECTMANAGER_EXPORT QmlProjectPlugin: public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProjectManager.json")
 
 public:
     QmlProjectPlugin();
diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h
index c0bbe0ce3aa8b7c886b3f8c8622a9d5db96b2d10..aa80311bf0cb2720c8742fe82a6e47eda1320280 100644
--- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h
+++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h
@@ -59,6 +59,7 @@ class ProFileEditorFactory;
 class Qt4ProjectManagerPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Qt4ProjectManager.json")
 
 public:
     Qt4ProjectManagerPlugin();
diff --git a/src/plugins/qtsupport/qtsupportplugin.h b/src/plugins/qtsupport/qtsupportplugin.h
index 8ea327febdeb90b175f8bcadce5b687f77c7533e..0400e313e9a309871197d6b47a6283c3733e2bcf 100644
--- a/src/plugins/qtsupport/qtsupportplugin.h
+++ b/src/plugins/qtsupport/qtsupportplugin.h
@@ -45,6 +45,7 @@ class ExamplesWelcomePage;
 class QtSupportPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QtSupport.json")
 
 public:
     bool initialize(const QStringList &arguments, QString *errorMessage);
diff --git a/src/plugins/remotelinux/remotelinuxplugin.h b/src/plugins/remotelinux/remotelinuxplugin.h
index 4ea667c84484d5365f632d6cfd4d47c8f81e7060..f8cc714074a4b26ed87cac3c40e9fb17f380b368 100644
--- a/src/plugins/remotelinux/remotelinuxplugin.h
+++ b/src/plugins/remotelinux/remotelinuxplugin.h
@@ -41,6 +41,7 @@ namespace Internal {
 class RemoteLinuxPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "RemoteLinux.json")
 
 public:
     RemoteLinuxPlugin();
diff --git a/src/plugins/resourceeditor/resourceeditorplugin.h b/src/plugins/resourceeditor/resourceeditorplugin.h
index 60a5ee63af93e1ae34b77c69404c369ee9a571f2..8415d623aad9e8973fc9dddb43e4516848159412 100644
--- a/src/plugins/resourceeditor/resourceeditorplugin.h
+++ b/src/plugins/resourceeditor/resourceeditorplugin.h
@@ -49,6 +49,7 @@ class ResourceEditorFactory;
 class ResourceEditorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ResourceEditor.json")
 
 public:
     ResourceEditorPlugin();
diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h
index e34875210169987b5cdd193813f594927d85cf9f..aaf504a1425e7f12b8d6ee96d7cf5b92a09f463c 100644
--- a/src/plugins/subversion/subversionplugin.h
+++ b/src/plugins/subversion/subversionplugin.h
@@ -79,6 +79,7 @@ struct SubversionResponse
 class SubversionPlugin : public VcsBase::VcsBasePlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Subversion.json")
 
 public:
     SubversionPlugin();
diff --git a/src/plugins/tasklist/tasklistplugin.h b/src/plugins/tasklist/tasklistplugin.h
index c2647739869f7715703c919bd8f1c7f55d0eee57..57873d370dbdceedb1a828604cbdc49b5db1e033 100644
--- a/src/plugins/tasklist/tasklistplugin.h
+++ b/src/plugins/tasklist/tasklistplugin.h
@@ -47,6 +47,7 @@ class TaskListPluginPrivate;
 class TaskListPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "TaskList.json")
 
 public:
     TaskListPlugin();
diff --git a/src/plugins/texteditor/texteditorplugin.h b/src/plugins/texteditor/texteditorplugin.h
index 1927cf8bb0700b2e60b1b2de9429c1826cb7fbbc..d518a67897c5385297c52456038dd0a7f173f0a4 100644
--- a/src/plugins/texteditor/texteditorplugin.h
+++ b/src/plugins/texteditor/texteditorplugin.h
@@ -55,6 +55,7 @@ class BaseTextMarkRegistry;
 class TextEditorPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "TextEditor.json")
 
 public:
     TextEditorPlugin();
diff --git a/src/plugins/todo/todoplugin.h b/src/plugins/todo/todoplugin.h
index efac7a23233095efc04b9725e63ec5ac26226c88..537d89d735c8d0345b24eaf5de8a7c478837acc3 100755
--- a/src/plugins/todo/todoplugin.h
+++ b/src/plugins/todo/todoplugin.h
@@ -49,6 +49,8 @@ class TodoItem;
 class TodoPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Todo.json")
+
 public:
     TodoPlugin();
     ~TodoPlugin();
diff --git a/src/plugins/updateinfo/updateinfoplugin.h b/src/plugins/updateinfo/updateinfoplugin.h
index fdc4c4c0e5b6c3229f771ba6da43570638aa7480..0c8511e6c64b5748de7d732b1e4f6ce4d29c5d01 100644
--- a/src/plugins/updateinfo/updateinfoplugin.h
+++ b/src/plugins/updateinfo/updateinfoplugin.h
@@ -45,6 +45,8 @@ class UpdateInfoPluginPrivate;
 class UpdateInfoPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "UpdateInfo.json")
+
 public:
     UpdateInfoPlugin();
     virtual ~UpdateInfoPlugin();
diff --git a/src/plugins/valgrind/valgrindplugin.h b/src/plugins/valgrind/valgrindplugin.h
index 937ce38d962953caaf30a67f7824a8e84e8c734a..9aa9e9c946e7ef326865ae38c10569da043010cb 100644
--- a/src/plugins/valgrind/valgrindplugin.h
+++ b/src/plugins/valgrind/valgrindplugin.h
@@ -44,6 +44,7 @@ namespace Internal {
 class ValgrindPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Valgrind.json")
 
 public:
     ValgrindPlugin() {}
diff --git a/src/plugins/vcsbase/vcsplugin.h b/src/plugins/vcsbase/vcsplugin.h
index 0147ece563b77b16ad11289ea1149e0b2b55c2e3..d60f13c2c14ba54034398590d44b3ad4e4b791bf 100644
--- a/src/plugins/vcsbase/vcsplugin.h
+++ b/src/plugins/vcsbase/vcsplugin.h
@@ -51,6 +51,7 @@ class CoreListener;
 class VcsPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "VcsBase.json")
 
 public:
     VcsPlugin();
diff --git a/src/plugins/welcome/welcomeplugin.h b/src/plugins/welcome/welcomeplugin.h
index 68664e3103d2a8652374e5ff9ceda30fb426e96b..32cfb79e9f649bddffa64723fa984171c21f1f82 100644
--- a/src/plugins/welcome/welcomeplugin.h
+++ b/src/plugins/welcome/welcomeplugin.h
@@ -47,6 +47,8 @@ class WelcomeMode;
 class WelcomePlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Welcome.json")
+
 public:
     WelcomePlugin();
 
diff --git a/src/qtcreatorplugin.pri b/src/qtcreatorplugin.pri
index 1e659e6ab8ddb3f9f26e1a0e1afc60bcacb140b7..53ceac018b9b574be94ee9ab781556475b7e22fb 100644
--- a/src/qtcreatorplugin.pri
+++ b/src/qtcreatorplugin.pri
@@ -57,6 +57,22 @@ copy2build.name = COPY ${QMAKE_FILE_IN}
 copy2build.CONFIG += no_link
 QMAKE_EXTRA_COMPILERS += copy2build
 
+greaterThan(QT_MAJOR_VERSION, 4) {
+#   Create a Json file containing the plugin information required by
+#   Qt 5's plugin system by running a XSLT sheet on the
+#   pluginspec file before moc runs.
+    XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns)
+
+    pluginspec2json.name = Create Qt 5 plugin json file
+    pluginspec2json.input = PLUGINSPEC
+    pluginspec2json.variable_out = GENERATED_FILES
+    pluginspec2json.output = $${TARGET}.json
+    pluginspec2json.commands = $$XMLPATTERNS -no-format -output $$pluginspec2json.output $$PWD/pluginjsonmetadata.xsl $$PLUGINSPEC
+    pluginspec2json.CONFIG += no_link
+    moc_header.depends += $$pluginspec2json.output
+    QMAKE_EXTRA_COMPILERS += pluginspec2json
+}
+
 macx {
     !isEmpty(TIGER_COMPAT_MODE) {
         QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/$${PROVIDER}/