title: Android maven using wrong java version
body: <p>I'm compiling my Android project against Android V2.2.1, I'm using an Android dependency:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;com.google.android&lt;/groupId&gt;
          &lt;artifactId&gt;android&lt;/artifactId&gt;
          &lt;version&gt;2.2.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Everything compiles fine and libraries that were introduced in later versions (Nfc related stuff for example) are not available and that's fine.</p>
  
  <p>The problem arises when I'm using pure java methods like String.isEmpty which were introduced only in V2.3+, for some reason Maven doesn't fail with "cannot find symbol" but the compilation passes, it only fails on the device that runs version 2.2.</p>
  
  <p>My android-maven-plugin conf:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;
      &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.1.1&lt;/version&gt;
      &lt;configuration&gt;
          &lt;androidManifestFile&gt;${project.basedir}/AndroidManifest.xml
          &lt;/androidManifestFile&gt;
          &lt;assetsDirectory&gt;${project.basedir}/assets&lt;/assetsDirectory&gt;
          &lt;resourceDirectory&gt;${project.basedir}/res&lt;/resourceDirectory&gt;
          &lt;nativeLibrariesDirectory&gt;${project.basedir}/src/main/native
          &lt;/nativeLibrariesDirectory&gt;
          &lt;sdk&gt;
              &lt;platform&gt;8&lt;/platform&gt;
          &lt;/sdk&gt;
          &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt;
      &lt;/configuration&gt;
      &lt;extensions&gt;true&lt;/extensions&gt;
  
  &lt;/plugin&gt;
  </code></pre>
  
  <p>How can I make sure that the compile will fail ?</p>