第二部分 mercurial及hudson配置
【创建mercurial(hg)资料库】
cd
/home/xjimmy/apache-maven-2.2.1/flex-maven-madeiracloud
hg init #初始化资料库
hg add #添加文件
hg commit #提交
abort: no username supplied (see "hg help config")
abort: no username supplied (see "hg help config")
cd .hg
vi hgrc
#添加如下内容
[path]
default =
ssh://xjimmy@xxx.xx.xx.x//home/xjimmy/apache-maven-2.2.1/flex-maven-madeiracloud
[ui]
username
= xjimmy xjimmyshcn@sohu.com
cd ..
hg commit
#输入注释,如 "初始导入"
以上步骤即完成了hg资料库创建
------------------------------------------------------------------------
【hudson配置】
【防火墙开通8002端口】
vi /etc/sysconfig/iptables
加入下行
-A RH-Firewall-1-INPUT -m state --state NEW -m
tcp -p tcp --dport 8002 -j ACCEPT
service iptables restart
【启动hudson服务】
cd /home/xjimmy
vi run.sh
#内容如下
java -jar hudson-2.1.0-beta.war
--httpPort=8002 &
配置hudson
【为hudson安装hg插件】
系统管理->管理插件->可选插件:选中Mercurial
Plugin 点“安装”,看到以下内容表示hg插件安装成功,重启hudson,使插件生效
【配置jdk,mercurial和maven】
系统管理->系统设置:
新建任务
设置项目的mercurial路径
点“ 立即构建”,
Build History | ||
#1 | 2011-6-29 10:17:50 | |
全部 失败 |
再点 “ 命令行输出”,可以看到如下具体内容:
------------------------------------------------------------------------
命令行输出
Started by user anonymous $ /usr/bin/hg clone --rev default /home/xjimmy/apache-maven-2.2.1/flex-maven-madeiracloud /root/.hudson/jobs/flex-maven-madeiracloud/workspace adding changesets adding manifests adding file changes added 1 changesets with 8 changes to 8 files updating to branch default 8 files updated, 0 files merged, 0 files removed, 0 files unresolved [workspace] $ /usr/bin/hg log --rev . --template {node} Found mavenVersion 2.2.1 from file jar:file:/home/xjimmy/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties Parsing POMs Discovered a new module com.madeiracloud:flex-maven-madeiracloud Flex Maven MadeiraCloud Discovered a new module com.madeiracloud:lib Flex Maven Library Discovered a new module com.madeiracloud:app Flex Maven Application Discovered a new module com.madeiracloud:war Flex Maven War [workspace] $ /usr/lib/jvm/java/bin/java -cp /root/.hudson/plugins/maven-plugin/WEB-INF/lib/maven-agent-2.0.1.jar:/home/xjimmy/apache-maven-2.2.1/boot/classworlds-1.1.jar hudson.maven.agent.Main /home/xjimmy/apache-maven-2.2.1 /root/.hudson/war/WEB-INF/lib/hudson-remoting-2.0.1.jar /root/.hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-2.0.1.jar 58617 /root/.hudson/plugins/maven-plugin/WEB-INF/lib/maven2.1-interceptor-1.2.jar<===[HUDSON REMOTING CAPACITY]===>channel startedExecuting Maven: -B -f /root/.hudson/jobs/flex-maven-madeiracloud/workspace/pom.xml install[INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Flex Maven MadeiraCloud [INFO] Flex Maven Library [INFO] Flex Maven Application [INFO] Flex Maven War[INFO] ------------------------------------------------------------------------ [INFO] Building Flex Maven MadeiraCloud [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------[INFO] [site:attach-descriptor {execution: default-attach-descriptor}][INFO] [install:install {execution: default-install}] [INFO] Installing /root/.hudson/jobs/flex-maven-madeiracloud/workspace/pom.xml to /root/.m2/repository/com/madeiracloud/flex-maven-madeiracloud/1.0-SNAPSHOT/flex-maven-madeiracloud-1.0-SNAPSHOT.pom [HUDSON] Archiving /root/.hudson/jobs/flex-maven-madeiracloud/workspace/pom.xml to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$flex-maven-madeiracloud/builds/2011-06-29_10-17-55/archive/com.madeiracloud/flex-maven-madeiracloud/1.0-SNAPSHOT/pom.xml [HUDSON] Archiving /root/.m2/repository/com/madeiracloud/flex-maven-madeiracloud/1.0-SNAPSHOT/flex-maven-madeiracloud-1.0-SNAPSHOT.pom to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$flex-maven-madeiracloud/builds/2011-06-29_10-17-55/archive/com.madeiracloud/flex-maven-madeiracloud/1.0-SNAPSHOT/flex-maven-madeiracloud-1.0-SNAPSHOT.pom[INFO] ------------------------------------------------------------------------ [INFO] Building Flex Maven Library [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/src/main/resources [INFO] [flexmojos:compile-swc {execution: default-compile-swc}] [INFO] Flexmojos 3.8 [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Not defined if locales should be merged or not [WARNING] Unable to find license.jar on classpath. Check wiki for instructions about how to add it: https://docs.sonatype.org/display/FLEXMOJOS/FAQ#FAQ-1.3[WARNING] Nothing expecified to include. Assuming source and resources folders. [INFO] Flex compiler configurations: -compiler.accessible=false -compiler.actionscript-file-encoding UTF-8 -compiler.allow-source-path-overlap=false -compiler.as3=true -compiler.debug=true -compiler.es=false -compiler.external-library-path /root/.m2/repository/com/adobe/flex/framework/playerglobal/3.2.0.3958/9/playerglobal.swc -compiler.fonts.local-fonts-snapshot /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/classes/fonts.ser -compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.AFEFontManager flash.fonts.BatikFontManager -compiler.headless-server=false -compiler.include-libraries= -compiler.keep-all-type-selectors=false -compiler.keep-generated-actionscript=false -compiler.library-path /root/.m2/repository/com/adobe/flex/framework/flex/3.2.0.3958/flex-3.2.0.3958.swc /root/.m2/repository/com/adobe/flex/framework/framework/3.2.0.3958/framework-3.2.0.3958.swc /root/.m2/repository/com/adobe/flex/framework/rpc/3.2.0.3958/rpc-3.2.0.3958.swc /root/.m2/repository/com/adobe/flex/framework/utilities/3.2.0.3958/utilities-3.2.0.3958.swc -compiler.locale= -compiler.namespaces.namespace http://www.adobe.com/2006/mxml /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/classes/config-3.2.0.3958/mxml-manifest.xml -compiler.optimize=true -compiler.source-path /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/src/main/flex -compiler.strict=true -compiler.use-resource-bundle-metadata=true -compiler.verbose-stacktraces=false -compute-digest=true -default-background-color 8821927 -default-frame-rate 24 -default-script-limits 1000 60 -default-size 500 375 -licenses.license flashbuilder4 1424-4008-9664-3602-3439-1711 -metadata.date Wed Jun 29 10:18:49 CST 2011 -metadata.localized-title Flex Maven Library x-default -target-player 9.0.0 -use-network=true -verify-digests=true -static-link-runtime-shared-libraries=false -load-config=[INFO] [resources:testResources {execution: default-testResources}] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/src/test/resources [INFO] [flexmojos:test-compile {execution: default-test-compile}] [INFO] Flexmojos 3.8 [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file [WARNING] Not defined if locales should be merged or not [WARNING] Unable to find license.jar on classpath. Check wiki for instructions about how to add it: https://docs.sonatype.org/display/FLEXMOJOS/FAQ#FAQ-1.3 [INFO] Compiling test class: [TestApp][INFO] Updating Flash Player Trust directory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/test-classes/TestRunner.swf [INFO] [flexmojos:test-run {execution: default-test-run}] [INFO] Flexmojos 3.8 [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file [INFO] Running tests /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/test-classes/TestRunner.swf [WARNING] [LAUNCHER] Using regular flashplayer tests
[INFO] ------------------------------------------------------------------------ [INFO] Tests run: 0, Failures: 0, Errors: 0, Time Elapsed: 0 sec [ERROR] Accept timed out/root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/test-classes/TestRunner.swf org.sonatype.flexmojos.test.TestRunnerException: Accept timed out/root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/test-classes/TestRunner.swf at org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.java:87) at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:279) at org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:164) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at hudson.maven.agent.Main.launch(Main.java:173) at hudson.maven.MavenBuilder.call(MavenBuilder.java:164) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:882) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:813) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) Caused by: java.net.SocketTimeoutException: Accept timed out at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:375) at java.net.ServerSocket.implAccept(ServerSocket.java:470) at java.net.ServerSocket.accept(ServerSocket.java:438) at org.sonatype.flexmojos.test.monitor.AbstractSocketThread.openClientSocket(AbstractSocketThread.java:124) at org.sonatype.flexmojos.test.monitor.AbstractSocketThread.run(AbstractSocketThread.java:62) ... 1 more [HUDSON] Recording test results
[INFO] [install:install {execution: default-install}] [INFO] Installing /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/lib-1.0-SNAPSHOT.swc to /root/.m2/repository/com/madeiracloud/lib/1.0-SNAPSHOT/lib-1.0-SNAPSHOT.swc[HUDSON] Archiving /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/pom.xml to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$lib/builds/2011-06-29_10-17-55/archive/com.madeiracloud/lib/1.0-SNAPSHOT/pom.xml [HUDSON] Archiving /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/lib-1.0-SNAPSHOT.swc to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$lib/builds/2011-06-29_10-17-55/archive/com.madeiracloud/lib/1.0-SNAPSHOT/lib-1.0-SNAPSHOT.swc [INFO] ------------------------------------------------------------------------ [INFO] Building Flex Maven Application [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/src/main/resources [INFO] [flexmojos:compile-swf {execution: default-compile-swf}] [INFO] Flexmojos 3.8 [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file [WARNING] Source file was not defined, flexmojos will guess one. [WARNING] Not defined if locales should be merged or not [WARNING] Unable to find license.jar on classpath. Check wiki for instructions about how to add it: https://docs.sonatype.org/display/FLEXMOJOS/FAQ#FAQ-1.3 [INFO] Flex compiler configurations: -compiler.accessible=false -compiler.actionscript-file-encoding UTF-8 -compiler.allow-source-path-overlap=false -compiler.as3=true -compiler.debug=false -compiler.es=false -compiler.external-library-path /root/.m2/repository/com/adobe/flex/framework/playerglobal/3.2.0.3958/9/playerglobal.swc -compiler.fonts.local-fonts-snapshot /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/target/classes/fonts.ser -compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.AFEFontManager flash.fonts.BatikFontManager -compiler.headless-server=false -compiler.include-libraries= -compiler.keep-all-type-selectors=false -compiler.keep-generated-actionscript=false -compiler.library-path /root/.m2/repository/com/adobe/flex/framework/flex/3.2.0.3958/flex-3.2.0.3958.swc /root/.m2/repository/com/adobe/flex/framework/framework/3.2.0.3958/framework-3.2.0.3958.swc /root/.m2/repository/com/adobe/flex/framework/rpc/3.2.0.3958/rpc-3.2.0.3958.swc /root/.m2/repository/com/adobe/flex/framework/utilities/3.2.0.3958/utilities-3.2.0.3958.swc /root/.hudson/jobs/flex-maven-madeiracloud/workspace/lib/target/lib-1.0-SNAPSHOT.swc /root/.m2/repository/com/adobe/flex/framework/framework/3.2.0.3958/framework-3.2.0.3958-en_US.rb.swc /root/.m2/repository/com/adobe/flex/framework/rpc/3.2.0.3958/rpc-3.2.0.3958-en_US.rb.swc -compiler.locale en_US -compiler.namespaces.namespace http://www.adobe.com/2006/mxml /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/target/classes/config-3.2.0.3958/mxml-manifest.xml -compiler.optimize=true -compiler.source-path /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/src/main/flex -compiler.strict=true -compiler.use-resource-bundle-metadata=true -compiler.verbose-stacktraces=false -default-background-color 8821927 -default-frame-rate 24 -default-script-limits 1000 60 -default-size 500 375 -licenses.license flashbuilder4 1424-4008-9664-3602-3439-1711 -metadata.date Wed Jun 29 10:19:22 CST 2011 -metadata.localized-title Flex Maven Application x-default -target-player 9.0.0 -use-network=true -verify-digests=true -static-link-runtime-shared-libraries=false -load-config= -metadata.language+=en_US[INFO] Updating Flash Player Trust directory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/target/app-1.0-SNAPSHOT.swf [INFO] [resources:testResources {execution: default-testResources}] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/src/test/resources [INFO] [flexmojos:test-compile {execution: default-test-compile}] [INFO] Flexmojos 3.8 [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file [WARNING] Test folder not found/root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/src/test/flex [INFO] [flexmojos:test-run {execution: default-test-run}] [INFO] Flexmojos 3.8 [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file [WARNING] Skipping test run. Runner not found: /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/target/test-classes [HUDSON] Recording test results [INFO] [install:install {execution: default-install}] [INFO] Installing /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/target/app-1.0-SNAPSHOT.swf to /root/.m2/repository/com/madeiracloud/app/1.0-SNAPSHOT/app-1.0-SNAPSHOT.swf [HUDSON] Archiving /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/pom.xml to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$app/builds/2011-06-29_10-17-55/archive/com.madeiracloud/app/1.0-SNAPSHOT/pom.xml [HUDSON] Archiving /root/.hudson/jobs/flex-maven-madeiracloud/workspace/app/target/app-1.0-SNAPSHOT.swf to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$app/builds/2011-06-29_10-17-55/archive/com.madeiracloud/app/1.0-SNAPSHOT/app-1.0-SNAPSHOT.swf [INFO] ------------------------------------------------------------------------ [INFO] Building Flex Maven War [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------[INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/src/main/resources [INFO] [flexmojos:copy-flex-resources {execution: default}] [INFO] Flexmojos 3.8 [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file [INFO] [compiler:compile {execution: default-compile}] [INFO] No sources to compile [INFO] [resources:testResources {execution: default-testResources}] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/src/test/resources [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] No sources to compile [INFO] [surefire:test {execution: default-test}] [INFO] No tests to run. [HUDSON] Recording test results[INFO] [war:war {execution: default-war}] [INFO] Packaging webapp [INFO] Assembling webapp[war] in [/root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/target/war-1.0-SNAPSHOT] [INFO] Processing war project [INFO] Copying webapp resources[/root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/src/main/webapp][INFO] Webapp assembled in[146 msecs] [INFO] Building war: /root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/target/war-1.0-SNAPSHOT.war [INFO] [install:install {execution: default-install}] [INFO] Installing /root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/target/war-1.0-SNAPSHOT.war to /root/.m2/repository/com/madeiracloud/war/1.0-SNAPSHOT/war-1.0-SNAPSHOT.war [HUDSON] Archiving /root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/pom.xml to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$war/builds/2011-06-29_10-17-55/archive/com.madeiracloud/war/1.0-SNAPSHOT/pom.xml [HUDSON] Archiving /root/.hudson/jobs/flex-maven-madeiracloud/workspace/war/target/war-1.0-SNAPSHOT.war to /root/.hudson/jobs/flex-maven-madeiracloud/modules/com.madeiracloud$war/builds/2011-06-29_10-17-55/archive/com.madeiracloud/war/1.0-SNAPSHOT/war-1.0-SNAPSHOT.war [INFO] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] ------------------------------------------------------------------------ [INFO] Flex Maven MadeiraCloud ............................... SUCCESS [4.245s] [INFO] Flex Maven Library .................................... SUCCESS [34.157s] [INFO] Flex Maven Application ................................ SUCCESS [2.373s] [INFO] Flex Maven War ........................................ SUCCESS [3.067s] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 27 seconds [INFO] Finished at: Wed Jun 29 10:19:28 CST 2011 [INFO] Final Memory: 32M/92M [INFO] ------------------------------------------------------------------------ channel stoppedFinished: SUCCESS
点“ Modules”,看到如下内容表示构建成功:
【maven及hg项目位置】
/home/xjimmy/apache-maven-2.2.1/flex-maven-madeiracloud
【hudson项目】
/root/.hudson
/root/.hudson/jobs
/root/.hudson/jobs/flex-maven-madeiracloud/lastStable