title: How do you integrate gradle and jboss 6 to generate working eclipse projects
body: <p><strong>The situation</strong></p>
  
  <p>I want to integrate a gradle script to specify the dependencies for JBoss AS 6 and use that script to create eclipse projects.  We are currently using gradle for a project.  It builds fine, and runs tests correctly, but when we try to import it into eclipse, we get errors.  We have a <em>property</em> variable called <em>jbossHome</em>.  I dumped all of the libs into one directory for jboss6 and that is what <em>jbossHome</em> points to.</p>
  
  <pre><code>repositories{
      fileTree(dir: jbossHome)  //include required JBoss jars
  }
  
  dependencies {
      providedCompile fileTree(dir: jbossHome)  // include the required JBoss jars    
  }
  </code></pre>
  
  <p><strong>The problem</strong></p>
  
  <p>When we import into Eclipse, we get the following errors:</p>
  
  <ul>
  <li>Java compiler level does not match the version of the installed Java project facet.  </li>
  <li>Target runtime jboss-6.0.0.Final Runtime is not defined.</li>
  </ul>
  
  <p>We have both a web service project and a jms project that we need to set this up for.</p>
  
  <p><strong>Question #1</strong>
   - How can I setup my project to use the maven repo and include/exclude the correct jars similar to this <a href="https://github.com/pgier/jboss-as/blob/gradle/build.gradle" rel="nofollow">jboss 7 example</a>?  </p>
  
  <p><strong>Question #2</strong>
   - If using the Maven repos, is there a way to specify it to cache it to a specific directory so it doesn't download every time for integration into a CI server like Jenkins?</p>
  
  <p>Note:  I have been jumping around projects and languages, and I am not that familiar with Gradle or Maven.  I am pretty familiar with CMake, but AFAIK there isn't a similar concept with dependencies and maven repos.</p>