当我尝试构建一个Android项目时,我无法弄清楚为什么Jenkins停止响应(我最终不得不重新启动Jenkins服务)。
我是新手,所以我不确定哪些信息对调试问题有用,但我很乐意提供所需的一切。
不确定这是否相关,但是当我重新启动Jenkins服务时,我发现Jenkins构建历史记录中缺少构建失败的构建。
奇怪的是我可以从命令行直接运行构建(如jenkins)而没有任何问题。我所要做的就是为ANDROID_HOME和JAVA_HOME设置环境变量,然后运行
mvn clean install.
我在无头的Ubuntu 12.04 LTS服务器上运行Jenkins。
当它停止时,Jenkins控制台输出中的最后一位是:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.793 sec
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- android-maven-plugin:3.2.0:emma (default-emma) @ application ---
[INFO]
[INFO] --- android-maven-plugin:3.2.0:dex (default-dex) @ application ---
[INFO] /var/lib/jenkins/tools/JDK/jdk-6/jre/bin/java [-Xmx1024M, -jar, /var/lib/jenkins/tools/android-sdk/platform-tools/lib/dx.jar, --dex, --output=/var/lib/jenkins/jobs/moodsherpa/workspace/android/application/target/classes.dex, /var/lib/jenkins/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar, /var/lib/jenkins/jobs/moodsherpa/workspace/android/application/target/classes, /var/lib/jenkins/.m2/repository/com/actionbarsherlock/library/4.0.2/library-4.0.2.apklib, /var/lib/jenkins/.m2/repository/com/commonsware/cwac-loaderex/0.3.0/cwac-loaderex-0.3.0.jar, /var/lib/jenkins/.m2/repository/com/google/inject/extensions/guice-assistedinject/3.0/guice-assistedinject-3.0.jar, /var/lib/jenkins/.m2/repository/com/google/inject/guice/3.0/guice-3.0-no_aop.jar, /var/lib/jenkins/.m2/repository/org/roboguice/roboguice/2.0/roboguice-2.0.jar, /var/lib/jenkins/.m2/repository/com/google/android/support-v4/r7/support-v4-r7.jar, /var/lib/jenkins/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar]
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
使用Maven -X标志:
[INFO] --- android-maven-plugin:3.2.0:dex (default-dex) @ application ---
[DEBUG] Configuring mojo com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0:dex from plugin realm ClassRealm[plugin>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0, parent: sun.misc.Launcher$AppClassLoader@77cde100]
[DEBUG] Configuring mojo 'com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0:dex' with basic configurator -->
[DEBUG] (f) aaptExtraArgs = []
[DEBUG] (f) androidManifestFile = /var/lib/jenkins/jobs/ms/workspace/android/application/AndroidManifest.xml
[DEBUG] (f) assetsDirectory = /var/lib/jenkins/jobs/ms/workspace/android/application/assets
[DEBUG] (f) attachJar = true
[DEBUG] (f) attachSources = false
[DEBUG] (f) combinedAssets = /var/lib/jenkins/jobs/ms/workspace/android/application/target/generated-sources/combined-assets/assets
[DEBUG] (f) combinedRes = /var/lib/jenkins/jobs/ms/workspace/android/application/target/generated-sources/combined-resources/res
[DEBUG] (f) dexCoreLibrary = false
[DEBUG] (f) dexJvmArguments = [-Xmx1024M]
[DEBUG] (f) dexNoLocals = false
[DEBUG] (f) dexOptimize = true
[DEBUG] (f) envANDROID_HOME = /var/lib/jenkins/tools/android-sdk/
[DEBUG] (f) extractedDependenciesAssets = /var/lib/jenkins/jobs/ms/workspace/android/application/target/generated-sources/extracted-dependencies/assets
[DEBUG] (f) extractedDependenciesDirectory = /var/lib/jenkins/jobs/ms/workspace/android/application/target/generated-sources/extracted-dependencies
[DEBUG] (f) extractedDependenciesJavaResources = /var/lib/jenkins/jobs/ms/workspace/android/application/target/generated-sources/extracted-dependencies/src/main/resources
[DEBUG] (f) extractedDependenciesJavaSources = /var/lib/jenkins/jobs/ms/workspace/android/application/target/generated-sources/extracted-dependencies/src/main/java
[DEBUG] (f) extractedDependenciesRes = /var/lib/jenkins/jobs/ms/workspace/android/application/target/generated-sources/extracted-dependencies/res
[DEBUG] (f) generateApk = true
[DEBUG] (f) nativeLibrariesDirectory = /var/lib/jenkins/jobs/ms/workspace/android/application/libs
[DEBUG] (f) project = MavenProject: com.ms.android:application:0.0.1-SNAPSHOT @ /var/lib/jenkins/jobs/ms/workspace/android/application/pom.xml
[DEBUG] (f) projectRepos = [central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] (f) repoSession = org.sonatype.aether.util.DefaultRepositorySystemSession@566e9e64
[DEBUG] (f) resourceDirectory = /var/lib/jenkins/jobs/ms/workspace/android/application/res
[DEBUG] (f) resourceOverlayDirectory = /var/lib/jenkins/jobs/ms/workspace/android/application/res-overlay
[DEBUG] (f) platform = 15
[DEBUG] (f) sdk = com.jayway.maven.plugins.android.configuration.Sdk@1f26ecd2
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@29eb0cd0
[DEBUG] (f) sourceDirectory = /var/lib/jenkins/jobs/ms/workspace/android/application/src/main/java
[DEBUG] (f) undeployBeforeDeploy = true
[DEBUG] (f) unpackedApkLibsDirectory = /var/lib/jenkins/jobs/ms/workspace/android/application/target/unpack/apklibs
[DEBUG] -- end configuration --
[DEBUG] Checking for existence of: /var/lib/jenkins/jobs/ms/workspace/android/application/target/proguard-obfuscated.jar
[DEBUG] Using non-obfuscated input
[DEBUG] Adding jvm argument -Xmx1024M
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
[DEBUG] Adding dex input: /var/lib/jenkins/jobs/ms/workspace/android/application/target/classes
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/com/actionbarsherlock/library/4.0.2/library-4.0.2.apklib
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/com/commonsware/cwac-loaderex/0.3.0/cwac-loaderex-0.3.0.jar
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/com/google/inject/extensions/guice-assistedinject/3.0/guice-assistedinject-3.0.jar
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/com/google/inject/guice/3.0/guice-3.0-no_aop.jar
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/org/roboguice/roboguice/2.0/roboguice-2.0.jar
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/com/google/android/support-v4/r7/support-v4-r7.jar
[DEBUG] Adding dex input: /var/lib/jenkins/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[INFO] /var/lib/jenkins/tools/JDK/jdk-6/jre/bin/java [-Xmx1024M, -jar, /var/lib/jenkins/tools/android-sdk/platform-tools/lib/dx.jar, --dex, --output=/var/lib/jenkins/jobs/ms/workspace/android/application/target/classes.dex, /var/lib/jenkins/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar, /var/lib/jenkins/jobs/ms/workspace/android/application/target/classes, /var/lib/jenkins/.m2/repository/com/actionbarsherlock/library/4.0.2/library-4.0.2.apklib, /var/lib/jenkins/.m2/repository/com/commonsware/cwac-loaderex/0.3.0/cwac-loaderex-0.3.0.jar, /var/lib/jenkins/.m2/repository/com/google/inject/extensions/guice-assistedinject/3.0/guice-assistedinject-3.0.jar, /var/lib/jenkins/.m2/repository/com/google/inject/guice/3.0/guice-3.0-no_aop.jar, /var/lib/jenkins/.m2/repository/org/roboguice/roboguice/2.0/roboguice-2.0.jar, /var/lib/jenkins/.m2/repository/com/google/android/support-v4/r7/support-v4-r7.jar, /var/lib/jenkins/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar]
答案 0 :(得分:1)
我从512升级到2048MB的RAM,这解决了我的问题。