title: Merging two JSON files based on common key value pair using jq
body: <p>I have 2 JSON files with the following structure</p>
  
  <p>File1.json</p>
  
  <pre><code>{
    "Plugins": [
                 {
                   "Name": "Plugin A",
                   "Installation": [
                    {
                      "Version": "1.0",
                      "Server" : "abc"
                    }
                    ]
                 },
                 {
                    "Name": "Plugin B",
                    "Installation": [
                     {
                       "Version": "2.0",
                       "Server" : "abc"
                     }
                     ]
                 },
                 {
                    "Name": "Plugin C",
                    "Installation": [
                     {
                       "Version": "2.0",
                       "Server" : "abc"
                     }
                     ]
                 }
     ]
  }
  </code></pre>
  
  <p>File2.json</p>
  
  <pre><code>{
    "Plugins": [
                 {
                   "Name": "Plugin A",
                   "Installation": [
                    {
                      "Version": "1.1",
                      "Server" : "xyz"
                    }
                    ]
                 },
                 {
                    "Name": "Plugin B",
                    "Installation": [
                     {
                       "Version": "2.0",
                       "Server" : "xyz"
                     }
                     ]
                  },
     ]
  }
  </code></pre>
  
  <p>I want to merge them and get the output like this</p>
  
  <pre><code>{
    "Plugins": [
                 {
                   "Name": "Plugin A",
                   "Installation": [
                    {
                      "Version": "1.0",
                      "Server" : "abc"
                    },
                    {
                      "Version": "1.1",
                      "Server" : "xyz"
                    }
                    ]
                 },
                 {
                    "Name": "Plugin B",
                    "Installation": [
                     {
                       "Version": "2.0",
                       "Server" : "abc"
                     },
                     {
                       "Version": "2.0",
                       "Server" : "xyz"
                     }
                     ]
                 },
                 {
                    "Name": "Plugin C",
                    "Installation": [
                     {
                       "Version": "2.0",
                       "Server" : "abc"
                     }
                     ]
                 }
     ]
  }
  </code></pre>
  
  <p>The two JSON files have exactly the same structure but only differ in terms of the content in the files.
  I am mainly looking at using <strong>jq</strong> utility. Shell or jenkins-groovy scripts would be fine as well. 
  Any help would be appreciated! </p>