{"id":2096,"date":"2017-12-07T10:28:05","date_gmt":"2017-12-07T10:28:05","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2096"},"modified":"2020-01-09T09:44:39","modified_gmt":"2020-01-09T09:44:39","slug":"creating-single-war-file-from-multiple-branches","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/creating-single-war-file-from-multiple-branches\/","title":{"rendered":"Creating single WAR file from multiple branches"},"content":{"rendered":"<p><strong>revanthreddy created the topic: Creating single WAR file from multiple branches<\/strong><br \/>\nHi,<\/p>\n<p>I am Revanth working for a product company. We are using Hudson for creating WAR files from SVN for our daily build purposes. Until these days everything went fine, but in recent days we have a change in SVN structure where I am stuck for preparing WAR file. Any help in this regard is highly appreciated.<\/p>\n<p>My problem area:<\/p>\n<p>We have a branch called \u201cA\u201d where platform files are checked in and another branch called \u201cB\u201d where product files are checked in. Through Hudson I need to prepare WAR file by combing \u201cA\u201d branch files on the top it branch \u201cB\u201d files. I need to checkout first \u201cA\u201d branch and then on the top it \u201cB\u201d branch files and build the WAR file.<\/p>\n<p>Please let me know who this can be achieved by using Hudson.<\/p>\n<p>Thanks&amp;Regards,<br \/>\nRevanth.<\/p>\n<p><strong>rajeshkumar replied the topic: Re: Creating single WAR file from multiple branches<\/strong><br \/>\nYou can sycn the both source code using hudson &#8211; job configuration&#8230;<\/p>\n<p>In Source Code Management = Subversion<br \/>\nand add as many Repository URL you want to sync&#8230;<\/p>\n<p>Once sync got completed, Write one build.xmkl file and add to hudson job configuration&#8230;<\/p>\n<p>Snippet of code below;<\/p>\n<p>More reference can be found&#8230;<br \/>\n<a href=\"http:\/\/ant.apache.org\/manual\/Tasks\/war.html\" target=\"_blank\" rel=\"noopener\">ant.apache.org\/manual\/Tasks\/war.html<\/a><br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>scmuser created the topic: How to restart Hudson?<\/strong><br \/>\nHow to restart hudson if i have installed like java &#8211; jar hudson.war<\/p>\n<p><strong>rajeshkumar replied the topic: Re:How to restart Hudson?<\/strong><br \/>\nReply from Hudson community&#8230;<\/p>\n<p>Running hudson directly like that runs it under the built-in Winstone web server. You can use some commands that it has to control your app:<\/p>\n<p>I do this:<\/p>\n<p>start:<br \/>\nnohup $JAVA_HOME\/bin\/java $HUDSON_JAVA_OPTS -jar $HOME\/wars\/hudson.war &#8211;controlPort=8001 &gt; $HOME\/logs\/hudson.log 2&gt;&amp;1 &amp;<\/p>\n<p>restart:<br \/>\njava -cp $HOME\/bin\/winstone-0.9.10.jar winstone.tools.WinstoneControl reload: &#8211;host=localhost &#8211;port=8001<\/p>\n<p>shutdown:<br \/>\njava -cp $HOME\/bin\/winstone-0.9.10.jar winstone.tools.WinstoneControl reload: &#8211;host=localhost &#8211;port=8001<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @<a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\"> twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>mnanjala replied the topic: Re:How to restart Hudson?<\/strong><br \/>\nYou can restart the service as below<\/p>\n<p>Got to \/etc\/init\/ (basically hudson service script resides here)<\/p>\n<p>hudson.sh restart<\/p>\n<p><strong>rajeshkumar replied the topic: Re:How to restart Hudson?<\/strong><br \/>\nWhat about in Windows?<\/p>\n<p>Can you please provide small notes on What are the ways to start &#8211; stop hudson in Linux and Windows?<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>mnanjala replied the topic: Re:How to restart Hudson?<\/strong><br \/>\nWell in windows you make it as a service is the best bet else from GUI itself you can restart.<\/p>\n<p>Command Line would be like this and here windows istreated as a slave.<br \/>\nsc.exe create HudsonSlave binPath= &#8220;C:\\WINDOWS\\system32\\java.exe -jar C:\\hudson\\slave.jar<br \/>\n-jnlpUrl http:\/\/SERVER:PORT\/computer\/MACHINE\/slave-agent.jnlp&#8221; start= auto<\/p>\n<p>This is a very simple version, you can elaborate start scripts which use some program to hide the CMD window, select the good server and try to ping it, get the MACHINE variable with %computername% ,etc&#8230;<\/p>\n<p><strong>amitanand123 replied the topic: Re:How to restart Hudson?<\/strong><br \/>\nYou can create .bat file<br \/>\ncd d:\\Program Files\\Hudson<br \/>\njava -DHUDSON_HOME=d:\\Hudson -jar hudson.war<\/p>\n<p>or you can use plugins to install as a service<\/p>\n<p>&#8220;Install as Windows Service&#8221;<\/p>\n<p>Installation Directory=d:\\Hudson\\.hudson<\/p>\n<p><strong>rajeshkumar replied the topic: Re:How to restart Hudson?<\/strong><br \/>\nI got some good links over net as well&#8230;<\/p>\n<p><a href=\"http:\/\/weblogs.java.net\/blog\/2008\/10\/08\/install...udson-service-redhat\" target=\"_blank\" rel=\"noopener\">weblogs.java.net\/blog\/2008\/10\/08\/install&#8230;udson-service-redhat <\/a><br \/>\n<a href=\"http:\/\/wiki.hudson-ci.org\/display\/HUDSON\/Instal...son+as+a+Unix+daemon\" target=\"_blank\" rel=\"noopener\">wiki.hudson-ci.org\/display\/HUDSON\/Instal&#8230;son+as+a+Unix+daemon<\/a><br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>revanthreddy created the topic: Creating single WAR file from multiple branches Hi, I am Revanth working for a product company. We are using Hudson for creating WAR files from SVN&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[29],"tags":[442],"class_list":["post-2096","post","type-post","status-publish","format-standard","hentry","category-maven","tag-branches"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2096"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2096\/revisions"}],"predecessor-version":[{"id":5332,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2096\/revisions\/5332"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}