2014-09-12 63 views
2

我想三天中創建一個科尼項目的自動生成。我正在使用Mac OSX。如何創建一個詹金斯科尼項目的建設 - 連續集成

當我做

$ su jenkins 
$ git clone [email protected]:/git/myproject.git 
$ cd myproject 
$ ant main 

這樣的項目成功地建立!

但是,如果我嘗試配置詹金斯做同樣的工作,它不工作!該問題發生在ant main

這是詹金斯日誌:

+ ant main 
ant main Buildfile: /Users/Shared/Jenkins/Home/jobs/myproject/workspace/myproject/build.xml 

main: 
    [echo] Looking for JAR antcontrib.jar at : /Users/Shared/Jenkins/Home/jobs/myproject/workspace/myproject/ant-contrib-0.6.jar 
    [echo] Started script... 
    [echo] Global properties file LOCATION: /Users/Shared/Jenkins/Home/jobs/myproject/workspace/myproject/global.properties 
    [echo] Build properties file LOCATION: /Users/Shared/Jenkins/Home/jobs/myproject/workspace/myproject/build.properties 
    [echo] WORKSPACE LOCATION: /Users/Shared/Jenkins/Home/jobs/myproject/workspace/ 
    [exec] _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. 
    [exec] [09-12-2014 10:19:20]Executing build file: /Applications/Kony/Kony_Studio/configuration/org.eclipse.osgi/bundles/261/1/.cp//masterbuild.xml 
    [exec] 
    [exec] commoninit: 
    [exec] cmdl.getCommandline(): [Ljava.lang.String;@4c309d4d 
    [exec] 
    [exec] ***********/bin/sh 
    [exec] 
    [exec] ***********/c 
    [exec] 
    [exec] ***********chmod 777 /Applications/Kony/Kony_Studio/configuration/org.eclipse.osgi/bundles/261/1/.cp//preview/node_mac/bin/node 
    [exec] 
    [exec] ***********/bin/sh 
    [exec] 
    [exec] ***********/c 
    [exec] 
    [exec] ***********-c 
    [exec] 
    [exec] midlog4jtarget: 
    [exec]  [echo] Copying thinclient jar files to jetty lib 
    [exec]  [copy] Copying 6 files to /Applications/Kony/Kony_Studio/configuration/org.eclipse.osgi/bundles/261/1/.cp/jettydeploy/lib 
    [exec]  [echo] Copying thinclient jar files to jetty lib 
    [exec]  [copy] Copying 1 file to /Applications/Kony/Kony_Studio/configuration/org.eclipse.osgi/bundles/261/1/.cp/jettydeploy/lib 
    [exec]  [copy] Copying 1 file to /Users/Shared/Jenkins/Home/jobs/myproject/workspace/middleware/middleware-bootconfig/tc 
    [exec] 2014-09-12 10:19:21.644::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 
    [exec] ***WARNING: Display must be created on main thread due to Cocoa restrictions. 
    [exec] [JETTY Server] HTTP - started and listening on [8888] 
    [exec] [JETTY Server] HTTPS - started and listening on [8443] 
    [exec] log4j:WARN No appenders could be found for logger (Licensing). 
    [exec] log4j:WARN Please initialize the log4j system properly. 
    [exec] 
    [exec] version= 1.5 
    [exec] 
    [exec] name= Android 1.5 
    [exec] 
    [exec] version= 1.6 
    [exec] 
    [exec] name= Android 1.6 
    [exec] 
    [exec] version= 2.1 
    [exec] 
    [exec] name= Android 2.1 
    [exec] 
    [exec] version= 2.2 
    [exec] 
    [exec] name= Android 2.2 
    [exec] 
    [exec] version= 2.3.3 
    [exec] 
    [exec] name= Android 2.3.3 
    [exec] 
    [exec] version= 3.0 
    [exec] 
    [exec] name= Android 3.0 
    [exec] 
    [exec] version= 3.1 
    [exec] 
    [exec] name= Android 3.1 
    [exec] 
    [exec] version= 3.2 
    [exec] 
    [exec] name= Android 3.2 
    [exec] 
    [exec] version= 4.0 
    [exec] 
    [exec] name= Android 4.0 
    [exec] 
    [exec] version= 4.0.3 
    [exec] 
    [exec] name= Android 4.0.3 
    [exec] 
    [exec] version= 4.1.2 
    [exec] 
    [exec] name= Android 4.1.2 
    [exec] 
    [exec] version= 4.2.2 
    [exec] 
    [exec] name= Android 4.2.2 
    [exec] 
    [exec] version= 4.3 
    [exec] 
    [exec] name= Android 4.3 
    [exec] 
    [exec] version= 4.4.2 
    [exec] 
    [exec] name= Android 4.4.2 
    [exec] 
    [exec] version= 4.4W 
    [exec] 
    [exec] name= Android 4.4W 
    [exec] 
    [exec] version= 1.5 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 1.6 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 2.1 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 2.2 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 2.3.3 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 3.0 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 3.1 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 3.2 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 3.2 
    [exec] 
    [exec] name= Google TV Addon 
    [exec] 
    [exec] version= 4.0 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 4.0.3 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 4.1.2 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 4.2.2 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 4.3 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 4.4.2 
    [exec] 
    [exec] name= Glass Development Kit Preview 
    [exec] 
    [exec] version= 4.4.2 
    [exec] 
    [exec] name= Google APIs 
    [exec] 
    [exec] version= 4.4.2 
    [exec] 
    [exec] name= Google APIs (x86 System Image) 
    [exec] 
    [exec] Version=7 
    [exec] 
    [exec] Version=8 
    [exec] 
    [exec] Version=10 
    [exec] 
    [exec] Version=11 
    [exec] 
    [exec] Version=12 
    [exec] 
    [exec] Version=13 
    [exec] 
    [exec] Version=14 
    [exec] 
    [exec] Version=15 
    [exec] 
    [exec] Version=16 
    [exec] 
    [exec] Version=17 
    [exec] 
    [exec] Version=18 
    [exec] 
    [exec] Version=19 
    [exec] Time taken for populating SDK List: 3832 
    [exec] Argument: /Users/Shared/Jenkins/Home/jobs/myproject/workspace/myproject/build.properties 
    [exec] Workspace Loc: /Users/Shared/Jenkins/Home/jobs/myproject/workspace 
    [exec] 
    [exec] [Jetty Server] Shutdown is successful 
    [exec] An error has occurred. See the log file 
    [exec] /Users/Shared/Jenkins/Home/jobs/myproject/workspace/.metadata/.log. BUILD FAILED /Users/Shared/Jenkins/Home/jobs/myproject/workspace/myproject/build.xml:123: exec returned: 13 

Total time: 28 seconds Build step 'Execute shell' marked build as failure Finished: FAILURE 

只記得,當我手動做了同樣的處理這個問題不會發生。 文件:/Users/Shared/Jenkins/Home/jobs/myproject/workspace/.metadata/.log

!SESSION 2014-09-12 10:34:09.679 ----------------------------------------------- 
eclipse.buildId=M20130204-1200 
java.version=1.8.0 
java.vendor=Oracle Corporation 
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US 
Framework arguments: -application com.pat.tool.keditor.konyapplication 
Command-line arguments: -data /Users/Shared/Jenkins/Home/jobs/myproject/workspace/ -application com.pat.tool.keditor.konyapplication 

This is a continuation of log file /Users/Shared/Jenkins/Home/jobs/myproject/workspace/.metadata/.bak_0.log 
Created Time: 2014-09-12 10:34:23.895 

!ENTRY org.eclipse.osgi 4 0 2014-09-12 10:34:23.895 
!MESSAGE Application error 
!STACK 1 
java.lang.NoClassDefFoundError: org/eclipse/ui/actions/SelectionListenerAction 
    at java.lang.ClassLoader.defineClass1(Native Method) 
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760) 
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188) 
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:632) 
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:607) 
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:568) 
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492) 
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465) 
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:464) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) 
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 
    at com.pat.tool.keditor.actions.ResourceActionHelper.runTasks(ResourceActionHelper.java:770) 
    at com.pat.tool.keditor.actions.ResourceActionHelper.runTasks(ResourceActionHelper.java:516) 
    at com.pat.tool.keditor.commandline.CommandLineApplication.start(CommandLineApplication.java:175) 
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:483) 
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) 
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) 
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438) 
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414) 
    at org.eclipse.core.launcher.Main.main(Main.java:34) 
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.ui.ide (210). 
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122) 
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:469) 
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395) 
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35) 
    at org.eclipse.osgi.internal.loader.MultiSourcePackage.loadClass(MultiSourcePackage.java:31) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) 
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) 
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 
    ... 32 more 
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.ui.internal.ide.IDEWorkbenchPlugin.start() of bundle org.eclipse.ui.ide. 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734) 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) 
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) 
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) 
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440) 
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:263) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107) 
    ... 42 more 
Caused by: java.lang.NullPointerException 
    at org.eclipse.swt.graphics.Device.getPrimaryScreen(Device.java:348) 
    at org.eclipse.swt.graphics.Device.getScreenDPI(Device.java:408) 
    at org.eclipse.swt.graphics.Device.getDPI(Device.java:343) 
    at org.eclipse.swt.graphics.Device.init(Device.java:542) 
    at org.eclipse.swt.widgets.Display.init(Display.java:2132) 
    at org.eclipse.swt.graphics.Device.<init>(Device.java:131) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:701) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:692) 
    at org.eclipse.swt.widgets.Display.getDefault(Display.java:1388) 
    at org.eclipse.ui.internal.ide.IDEWorkbenchPlugin.createProblemsViews(IDEWorkbenchPlugin.java:394) 
    at org.eclipse.ui.internal.ide.IDEWorkbenchPlugin.start(IDEWorkbenchPlugin.java:351) 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702) 
    ... 48 more 
+1

詹金斯可以使用各種JDKs,可以安裝詹金斯的使用。 Jenkins運行JDK的版本是否可能比從命令行運行Ant的時候多? – 2014-09-12 14:40:32

+0

在這兩個我有同樣的螞蟻版本和相同的Java版本: Apache Ant的(TM)1.9.4版本 - 的Java版本,我真是在Mac上登錄爲用戶詹金斯「1.8.0」 – JonatasTeixeira 2014-09-12 15:11:36

回答

2

這個問題似乎是:

 [exec] _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. 

你使用一些工具,想要創造窗戶和畫在屏幕上。如果您使用標準安裝程序安裝Jenkins,則這是不可能的。 Jenkins的Mac安裝程序使其作爲啓動守護程序運行,該守護程序是無法訪問圖形系統的後臺服務。

你有三個選擇:

  • 檢查是否有調用的方式,它並不需要在屏幕上繪製工具的方式。也許有一個選項可以在「無頭」模式下運行。
  • 如果這是不可能的,建立一個JNLP類型的從詹金斯。然後從GUI控制檯登錄到Mac並啓動會話中正在運行的從站。讓自己登錄。
  • 或者,在GUI會話中運行Jenkins主設備。我有一個很好的前端/助手做這件事:https://github.com/stisti/jenkins-app
+0

的solutioons。其不是很漂亮,但它的工作原理! – JonatasTeixeira 2014-09-19 16:03:33