title: Safest way to automatically generate Java .class files from source, independent of build enviroment
body: <p>This might sound like an odd problem, but I'm trying to generate .class files from a given Java project, in an attempt to automatically scan compiled Java code and find bugs.</p>
  <p>The process goes like this:</p>
  <ul>
  <li>User requests scan of GitHub repo</li>
  <li>Script downloads repo (mainly Java code in this case), and in some way builds/compiles it.</li>
  <li>Script runs SpotBugs (or other compile-code analyzer) on the compiled code to find any errors or surface-level bugs</li>
  <li>Script reports results of scan back to user</li>
  </ul>
  <p>Is there any way to guarantee a set of class files across different build tools? Some projects use maven, others gradle, and with gradle you're not guaranteed class files as output.</p>
  <p>Any help / pointers much appreciated!</p>