title: How Create Gradle sharedManifest for multiple projects?
body: <p>I have multiple java projects. these projects are creating jar,war and ear files using gradle. In each project I have used manifest file to maintain the meta data like version,date-time...
  Fro this I have included the manifest file creation logic in every build.gradle file.</p>
  
  <pre><code>manifest {
       attributes( 
      'Bundle-Vendor' : "$BUNDLE_VENDOR",
      'Build-Time': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")) 
  }
  </code></pre>
  
  <p>But in Gradle there is a feature call <strong>sharedManifest</strong>. I have defined the bellow two tasks in main project <strong>build.gradle</strong> script. But in the every jar and war file have the default MANIFEST.MF file created by Gradle.</p>
  
  <pre><code>ext.sharedManifest = manifest {
  
      attributes( 
          'Bundle-Vendor' : "$BUNDLE_VENDOR", 
           'Build-Time': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
       ) 
  }
  
  task fooJar(type: Jar) {
      manifest = project.manifest {
          from sharedManifest
      }
  }
  
  task fooWar(type: War) {
      manifest = project.manifest {
          from sharedManifest
      }
  }
  </code></pre>
  
  <p>jar.manifest.writeTo("/MANIFEST.MF")
  war.manifest.writeTo("/MANIFEST.MF")</p>
  
  <p>please can some one give the suggestion how to do this.</p>