Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven android build gives compile time errors as if it's building with -target=1.5
    text
    copied!<p>During my maven build I'm getting errors like this:</p> <p>[ERROR] /sandbox/mobile-apps/quickdroid/test/src/com/xxx/MyActivity.java:[14,21] java.util.LinkedHashMap.Entry has private access in java.util.LinkedHashMap</p> <p>I created a simple test project with one class. This error corresponds to this code:</p> <pre><code> LinkedHashMap.Entry&lt;String, Object&gt; test; </code></pre> <p>Intellij compiles this code just fine. If I change the -target=1.5 in my intellij javac parameters then I get the same error. Below in my pom.xml I've specified target 1.6 and verified with the -X parameter that maven is getting this setting. Why do I get errors as if it's still compiling target 1.5?</p> <p>excerpts from maven -X output: 1.6</p> <p>.</p> <p>[DEBUG] (f) source = 1.6 [DEBUG] (f) staleMillis = 0 [DEBUG] (f) target = 1.6</p> <p>.</p> <p>[DEBUG] Command line options: [DEBUG] -d /sandbox/mobile-apps/quickdroid/test/target/classes -classpath {...} -g -nowarn -target 1.6 -source 1.6</p> <p>pom.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; </code></pre> <p>http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0</p> <pre><code>&lt;groupId&gt;com.xxx.android&lt;/groupId&gt; &lt;artifactId&gt;test&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;apk&lt;/packaging&gt; &lt;name&gt;test&lt;/name&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;com.google.android&lt;/groupId&gt; &lt;artifactId&gt;android&lt;/artifactId&gt; &lt;version&gt;4.1.1.4&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt; &lt;plugins&gt; &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.3.2&lt;/version&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;configuration&gt; &lt;sdk&gt; &lt;!-- platform or api level (api level 4 = platform 1.6)--&gt; &lt;platform&gt;11&lt;/platform&gt; &lt;/sdk&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.5.1&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; </code></pre> <p></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload