title: Override the compiler attribute in an Ant javac task
body: <p>I'm trying to override Ant compiler attributes via the command line so that all 'javac' tasks use my specified compiler.
  The problem I've run into is that any target that sets its own value for compiler overrides the one that I set at the commmand line.  So, even though I'm entering the following command.</p>
  
  <pre><code>ant -Dbuild.compiler=mycompiler  
  </code></pre>
  
  <p>Any target that has the following is going to use the modern compiler instead of mycompiler because of that compiler="modern" attribute  </p>
  
  <pre><code>&lt;javac srcdir="."  
         destdir="${classes.dir}/core"  
         compiler="modern"  
         encoding="UTF-8"&gt;  
      &lt;include name="org/**" /&gt;  
      &lt;include name="com/**" /&gt;  
      &lt;compilerarg line="${config.build.compilerarg}" /&gt;  
  &lt;/javac&gt;    
  </code></pre>
  
  <p>Is there any way to override this from the command line, or am I stuck editing the build file?</p>