I am trying to overcome the length limit of cmd.exe
when building an Android project on Windows7.
I've already mapped M2_REPO
and Android SDK to subst drives, but I still hit the limit due to large number of packages in the project I am building.
I tried running my mvn build from Powershell and Git Bash (which is a MINGW32), however in both cases I get the same error showing that Maven runs cmd.exe
as one of the steps.
Is there a way to tell android-maven-plugin
to use other shell than cmd.exe
so it calls Git Bash instead (or Powershell)?
The error I am getting looks like this:
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.1:dex (default-dex) on project MyProject: MojoExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C ""c:\Program Files (x86)\Java\jdk1.7.0_75\jre\bin\java" -Xms512m -Xmx2048m -jar A:\build-tools\19.1.0\lib\dx.jar --dex --output=... (logs of jars from repository), Result = 1 -> [Help 1]
The command seems to be 7753 characters long as printed in the output, which is less than 8192 supposed limit of cmd.exe
, but in the past I was able to fix it just by adding subst drives so I assume that this is still the case of hitting the command line length limit. And I cannot make it any shorter since all jars I have there are references to the apklib files from maven repository mapped to M:
.
(Maven 3.0.5)