2014-12-31 29 views
1

我最近爲我第一次設置了一個Jenkins的CI環境。我很明顯開始有問題了。我建立了git(這似乎很好地工作),然後gradle。無法初始化本機平臺。在詹金斯

當我啓動構建我得到這個錯誤:

+ gradle build 
Could not load Logmanager "org.apache.juli.ClassLoaderLogManager" 
java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager 
    at java.net.URLClassLoader$1.run(Unknown Source) 
    at java.net.URLClassLoader$1.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at java.util.logging.LogManager$1.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.util.logging.LogManager.<clinit>(Unknown Source) 
    at org.gradle.logging.internal.JavaUtilLoggingConfigurer.configure(JavaUtilLoggingConfigurer.java:36) 
    at org.gradle.logging.internal.DefaultLoggingConfigurer.configure(DefaultLoggingConfigurer.java:34) 
    at org.gradle.logging.internal.LoggingSystemAdapter.setLevel(LoggingSystemAdapter.java:55) 
    at org.gradle.logging.internal.LoggingSystemAdapter.on(LoggingSystemAdapter.java:42) 
    at org.gradle.logging.internal.DefaultLoggingManager$StartableLoggingSystem.start(DefaultLoggingManager.java:173) 
    at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:58) 
    at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:29) 
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:201) 
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) 
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 
    at org.gradle.launcher.Main.doAction(Main.java:33) 
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) 
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) 
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 

FAILURE: Build failed with an exception. 

* What went wrong: 
Could not create an instance of type org.gradle.invocation.DefaultGradle_Decorated. 

這裏是一個完整的--stacktrace --info --debug version of the error

+1

解決。沒關係... –

+2

記住你在這裏的答案嗎? :) Stack是爲了回答好的問題和答案。如果他們遇到同樣的問題,我不會看到未來的用戶找到解決方案(除非deveshase的解決方案是正確的) – Patrice

+1

對不起。事實上,錯誤仍然存​​在,但並不能阻止工作的完成。真正的錯誤在最後兩行。我用這個:[link](http://www.davidandersen.us/uncategorized/gradle-libnative-platform-so-error-on-jenkins/)並安裝了libnative-platform。這解決了我的問題! –

回答

1

實際的問題是一個在最後一排:

* What went wrong: 
Could not create an instance of type org.gradle.invocation.DefaultGradle_Decorated. 

我找到了解決這個link

+0

正如上面的鏈接中提到的''強制GRADLE_USER_HOME使用工作區'也適用於我。 – Aurvoir

2

這是的結果-Djava.util.logging.manager = org.apache.juli.ClassLoaderLogManager被設置爲默認的JAVA_OPTS。這在某些環境中會造成gradle的麻煩。

將構建中的JAVA_OPTS設置爲防止違約的任何內容。

此外,請嘗試在您的構建中禁用GRADLE來分類問題。