I'm bringing an old android project back to live and i decided to use maven (m2e-android), works nicely after some fiddling. One problem i'm stil having is that i get a "must override a superclass method" errors, for example on the following code:
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
act.finish();
}
}
Of course i browsed around and discovered: 'Must Override a Superclass Method' Errors after importing a project into Eclipse
But this one doesn't say anything about maven.
I know you can specify source and target level in maven in pom.xml like:
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
Works great in normal, non android, projects. But it doesn't seem to have any effects in my android project (also tried updating my maven project, java compiler is also set to 1.6 automatically)
Here is my pom.xml for reference:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com..bee</groupId>
<artifactId>client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>client</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.6</java.version>
<platform.version>4.1.1.4</platform.version>
<android.plugin.version>3.9.0-rc.2</android.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
...
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android.plugin.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<versionRange>[3.8.0,)</versionRange>
<goals>
<goal>consume-aar</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
</project>
I suspect i'm missing a small thing. How can i get rid of the "must override a superclass method" without removing the @Override annotation?