Error resolving version for 'com.jayway.maven.plugins.android.generation2:maven-android-plugin': Plugin requires Maven version 2.2.1

860 views
Skip to first unread message

matthias

unread,
Jan 29, 2010, 8:21:29 AM1/29/10
to Maven Android Developers
Hi,

I always see this error in my pom.xml in Eclipse. The project builds
fine on the command line, but this is really distracting. Any idea
what could be causing this?
Here is my POM:

<?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.qype.radar</groupId>
<artifactId>qype-radar</artifactId>
<packaging>pom</packaging>
<name>Qype Radar</name>
<version>2.3</version>

<modules>
<module>radar-app</module>
<module>radar-tests</module>
</modules>

<properties>
<androidVersion>1.6</androidVersion>
<mavenAndroidPluginVersion>2.2.2</mavenAndroidPluginVersion>
</properties>

<prerequisites>
<maven>2.2.1</maven>
</prerequisites>

<dependencies>

<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>${androidVersion}_r2</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.github.droidfu</groupId>
<artifactId>droid-fu</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-commonshttp4</artifactId>
<version>1.1</version>
</dependency>

<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j</artifactId>
<version>0.6</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.0.1</version>
</dependency>

</dependencies>

<build>
<plugins>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>

<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</
groupId>
<artifactId>maven-android-plugin</artifactId>
<version>${mavenAndroidPluginVersion}</version>
<configuration>
<jvmArguments>
<!-- the dexer breaks with OutOfMemory, so let's double
the fucking heap -->
<jvmArgument>-Xmx256m</jvmArgument>
</jvmArguments>
</configuration>
</plugin>

</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</
groupId>
<artifactId>maven-android-plugin</artifactId>
<version>${mavenAndroidPluginVersion}</version>
<configuration>
<sdk>
<path>${env.ANDROID_HOME}</path>
<platform>${androidVersion}</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>


Thanks,
Matthias

matthias

unread,
Jan 29, 2010, 11:46:09 AM1/29/10
to Maven Android Developers
it looks as if this is a problem with the m2eclipse plugin.

Does this work for you? Which versions of the m2eclipse plugin and
Maven are you using along with maven-android-plugin?

mosabua

unread,
Jan 29, 2010, 11:50:22 AM1/29/10
to Maven Android Developers
I have the same hunch. The plugin requires Maven 2.2.1 and if you are
using an old version of eclipse or m2eclipse (which both use an
embedded maven) it might be too old. The latest versions of m2eclipse
are already embedding the 3x branch as far as I know so you are fine
with that. I am using the 3x branch on the command line and it works
fine..

manfred

matthias

unread,
Jan 29, 2010, 11:59:04 AM1/29/10
to Maven Android Developers
Hi,

I actually configured m2eclipse to NOT use the embedded version, but
my local Maven 2.2.1 installation. Still, no luck.

I meanwhile extracted the offending piece in the POM, it's the maven-
android-plugin configuration in the pluginManagement section:

<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</
groupId>
<artifactId>maven-android-plugin</artifactId>
<version>${mavenAndroidPluginVersion}</version>
<configuration>
<sdk>
<path>${env.ANDROID_HOME}</path>
<platform>${androidVersion}</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>

if I remove that, the POM builds fine.

I don't really understand what's going on here. Why would I need Maven
3.x in Eclipse, while everything works using 2.2.1 on the command
line? That doesn't seem to make much sense.

Thanks,
Matthias

mosabua

unread,
Jan 29, 2010, 12:11:24 PM1/29/10
to Maven Android Developers
I am not saying you need 3x just that it should work too. But the
config you use with using the external maven should work as well.

I am a bit stumped by this too. Does it work if you just have the
plugin in the build section (not that it should make a difference..)?

manfred

matthias

unread,
Jan 29, 2010, 1:01:47 PM1/29/10
to Maven Android Developers
no, I tried that already :-/

Hugo Josefson

unread,
Feb 3, 2010, 2:08:16 PM2/3/10
to Maven Android Developers
Hi guys,

To fix this, I have committed a fix which specifies our Maven
requirement like this instead:

<prerequisites>
<maven>[2.2.1,)</maven>
</prerequisites>

This way of specifying it should mean any versions equal to, or
greater than, 2.2.1.

Please try <version>2.2.3-SNAPSHOT</version> of maven-android-plugin,
according to these instructions (EASY!):
http://code.google.com/p/maven-android-plugin/wiki/SnapshotRepo

Let us know how it works for you.

Thanks,
Hugo

matthias

unread,
Feb 12, 2010, 9:43:38 AM2/12/10
to Maven Android Developers
thanks, I meanwhile fixed the problem by upgrading m2eclipse to the
latest 3.0.x dev build.
Reply all
Reply to author
Forward
0 new messages