How to specify ANDROID_HOME path for Maven under IntelliJ

androidintellij-ideamaven

I'm very new to Maven, and on top of that I'm forced to use the IntelliJ which is new environment as well for me.

While building project with the Maven in IntelliJ 12.0.3 I'm getting compilation error:

Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources (default-generate-sources) on project merchant: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources failed: Path "C:\adt-bundle-windows-x86_64\adt-bundle-windows\sdk\platform-tools\platforms" is not a directory. Please provide a proper Android SDK directory path as configuration parameter … in the plugin . As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=… or set environment variable ANDROID_HOME. -> [Help 1]

I added to Environmental variables:
ANDROID_HOME with parameter: C:…\sdk\platform-tools but it seems that it's still incorrect.

Yesterday, when this error occured on a different branch I was using, one guy was able to fix it with some settings in the File –> Settings –> Maven –> Runner –> Add Maven Property.
I've checked the list there but it was not conclusive :(. I think he added a property name and the value by hand.

Thanks for your help!

Best Answer

You can add the Android-SDK-Path to the commandline:

In Settings -> Maven -> Runner add a propery with

Name  = android.sdk.path
Value = <path to your android-sdk>

This fixed the Problem for me

Related Question