1

这是我执行 mvn install 时引发的错误的堆栈跟踪:

    [INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.511s
[INFO] Finished at: Fri Jun 15 10:20:12 EDT 2012
[INFO] Final Memory: 14M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0:dex (default-dex) on project dp-marketplace: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /Users/dev/Workspace/App/dp-marketplace-android.git && /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx1024M -jar /Users/dev/Workspace/android-sdk-macosx/platform-tools/lib/dx.jar --dex --output=/Users/dev/Workspace/App/dp-marketplace-android.git/target/classes.dex /Users/dev/.m2/repository/org/ektorp/org.ektorp.android/1.3.1-SNAPSHOT/org.ektorp.android-1.3.1-SNAPSHOT.jar /Users/dev/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar /Users/dev/.m2/repository/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar /Users/dev/.m2/repository/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar /Users/dev/.m2/repository/com/actionbarsherlock/library/4.1.0/library-4.1.0.apklib /Users/dev/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar /Users/dev/.m2/repository/org/khronos/opengl-api/gl1.1-android-2.1_r1/opengl-api-gl1.1-android-2.1_r1.jar /Users/dev/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar /Users/dev/.m2/repository/com/google/android/android/4.0.1.2/android-4.0.1.2.jar /Users/dev/.m2/repository/org/ektorp/org.ektorp/1.3.1-SNAPSHOT/org.ektorp-1.3.1-SNAPSHOT.jar /Users/dev/Workspace/App/dp-marketplace-android.git/target/classes /Users/dev/.m2/repository/org/apache/commons/commons-lang3/3.0.1/commons-lang3-3.0.1.jar /Users/dev/.m2/repository/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar /Users/dev/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar /Users/dev/.m2/repository/commons-fileupload/commons-fileupload/1.2.2/commons-fileupload-1.2.2.jar /Users/dev/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.7/jackson-core-asl-1.9.7.jar /Users/dev/.m2/repository/org/json/json/20080701/json-20080701.jar /Users/dev/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar /Users/dev/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar /Users/dev/.m2/repository/com/couchbase/android/couchbase-dp/2.0.0-31/couchbase-dp-2.0.0-31.jar /Users/dev/.m2/repository/com/google/android/support-v4/r7/support-v4-r7.jar /Users/dev/.m2/repository/com/couchbase/android/OtpErlang/r14b03/OtpErlang-r14b03.jar /Users/dev/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.7/jackson-mapper-asl-1.9.7.jar /Users/dev/.m2/repository/org/apache/httpcomponents/httpclient-cache/4.1.2/httpclient-cache-4.1.2.jar /Users/dev/.m2/repository/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar /Users/dev/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar /Users/dev/.m2/repository/com/comp/press/dp-android-library/0.1-SNAPSHOT/dp-android-library-0.1-SNAPSHOT.apklib /Users/dev/.m2/repository/com/comp/couch-transfer/1.0-SNAPSHOT/couch-transfer-1.0-SNAPSHOT.jar, Result = 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0:dex (default-dex) on project dp-marketplace: 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: 
    at com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.runDex(DexMojo.java:232)
    at com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.execute(DexMojo.java:116)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /Users/dev/Workspace/App/dp-marketplace-android.git && /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx1024M -jar /Users/dev/Workspace/android-sdk-macosx/platform-tools/lib/dx.jar --dex --output=/Users/dev/Workspace/App/dp-marketplace-android.git/target/classes.dex /Users/dev/.m2/repository/org/ektorp/org.ektorp.android/1.3.1-SNAPSHOT/org.ektorp.android-1.3.1-SNAPSHOT.jar /Users/dev/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar /Users/dev/.m2/repository/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar /Users/dev/.m2/repository/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar /Users/dev/.m2/repository/com/actionbarsherlock/library/4.1.0/library-4.1.0.apklib /Users/dev/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar /Users/dev/.m2/repository/org/khronos/opengl-api/gl1.1-android-2.1_r1/opengl-api-gl1.1-android-2.1_r1.jar /Users/dev/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar /Users/dev/.m2/repository/com/google/android/android/4.0.1.2/android-4.0.1.2.jar /Users/dev/.m2/repository/org/ektorp/org.ektorp/1.3.1-SNAPSHOT/org.ektorp-1.3.1-SNAPSHOT.jar /Users/dev/Workspace/App/dp-marketplace-android.git/target/classes /Users/dev/.m2/repository/org/apache/commons/commons-lang3/3.0.1/commons-lang3-3.0.1.jar /Users/dev/.m2/repository/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar /Users/dev/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar /Users/dev/.m2/repository/commons-fileupload/commons-fileupload/1.2.2/commons-fileupload-1.2.2.jar /Users/dev/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.7/jackson-core-asl-1.9.7.jar /Users/dev/.m2/repository/org/json/json/20080701/json-20080701.jar /Users/dev/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar /Users/dev/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar /Users/dev/.m2/repository/com/couchbase/android/couchbase-dp/2.0.0-31/couchbase-dp-2.0.0-31.jar /Users/dev/.m2/repository/com/google/android/support-v4/r7/support-v4-r7.jar /Users/dev/.m2/repository/com/couchbase/android/OtpErlang/r14b03/OtpErlang-r14b03.jar /Users/dev/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.7/jackson-mapper-asl-1.9.7.jar /Users/dev/.m2/repository/org/apache/httpcomponents/httpclient-cache/4.1.2/httpclient-cache-4.1.2.jar /Users/dev/.m2/repository/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar /Users/dev/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar /Users/dev/.m2/repository/com/comp/press/dp-android-library/0.1-SNAPSHOT/dp-android-library-0.1-SNAPSHOT.apklib /Users/dev/.m2/repository/com/comp/couch-transfer/1.0-SNAPSHOT/couch-transfer-1.0-SNAPSHOT.jar, Result = 1
    at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.java:215)
    at com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.runDex(DexMojo.java:230)
    ... 22 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我对 Maven 很陌生,我不确定到底是什么问题。有人对我应该如何着手解决这个问题有任何建议吗?

4

1 回答 1

1

嗯..android依赖项应该有一个provided范围..添加<scope>provided</scope>解决了问题..

于 2012-06-20T21:28:53.483 回答