title: How to make gradle generate a valid pom.xml file at the root of a project for maven users?
body: <p>While only for two days now, I am definitely sold on using gradle for all of my Java projects, and drop pom.xml from the root of all my projects.</p>
  
  <p>However, I would like to remain maven-compatible, in the sense that I would like for a gradle task to be able to generate a suitable pom.xml at the root of the project should the user want it.</p>
  
  <p>At this moment, the only reference to a pom.xml I have is in this section of the build.gradle file (this is, with very few modifications, what is found <a href="http://jedicoder.blogspot.fr/2011/11/automated-gradle-project-deployment-to.html">here</a>):</p>
  
  <pre><code>uploadArchives {
      repositories {
          mavenDeployer {
              beforeDeployment {
                  MavenDeployment deployment -&gt; signing.signPom(deployment);
              }
  
              repository(url: sonatypeRepoURI) {
                  authentication(userName: sonatypeUsername,
                      password: sonatypePassword);
              }
  
              pom.project {
                  name "${name}";
                  packaging "bundle";
                  description "${description}";
                  url "${projectURL}";
  
                  scm {
                      url "${gitroscm}";
                      connection "${gitroscm}";
                      developerConnection "${gitrwscm}";
                  }
  
                  licenses {
                      license {
                          name "Lesser General Public License, version 3 or greater";
                          url "http://www.gnu.org/licenses/lgpl.html";
                          distribution "repo";
                      }
                  }
  
                  developers {
                      developer {
                          id "whocares";
                          name "whocares";
                          email "whocares";
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>How would I extract the <code>pom.project</code> out of this very deeply nested construct into a task which could generate a pom.xml (by default, the generated pom.xml is in <code>build/poms/pom-default.xml</code> and looks quite good)?</p>
  
  <p>More importantly, is it possible to extract that <code>pom.project</code> out of <code>uploadArchives</code> while still being able to refer to it?</p>
  
  <p>Full link to the build.gradle file: <a href="https://github.com/fge/json-schema-core/raw/master/build.gradle">here</a>.</p>