<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://nozaki.me/roller/roller-ui/styles/rss.xsl" media="screen"?><rss version="2.0" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
  <title>Kohei Nozaki&apos;s blog</title>
  <link>https://nozaki.me/roller/kyle/</link>
      <atom:link rel="self" type="application/rss+xml" href="https://nozaki.me/roller/kyle/feed/entries/rss?cat=Jenkins" />
    <description>Notes of my experiments</description>
  <language>en-us</language>
  <copyright>Copyright 2024</copyright>
  <lastBuildDate>Wed, 1 May 2024 08:28:13 +0000</lastBuildDate>
  <generator>Apache Roller 5.2.0</generator>
        <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/configuring-automatic-push-by-successfully</guid>
    <title>Configuring automatic push by successfully build</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/configuring-automatic-push-by-successfully</link>
        <pubDate>Sun, 1 Mar 2015 14:19:51 +0000</pubDate>
    <category>Jenkins</category>
    <category>git</category>
    <category>jenkins</category>
            <description>&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Making Jenkins to push to an another remote repository if build finishes successfully.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;_recipe&quot;&gt;Recipe&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;olist arabic&quot;&gt;
&lt;ol class=&quot;arabic&quot;&gt;
&lt;li&gt;
&lt;p&gt;Create a bare repository&lt;/p&gt;
&lt;div class=&quot;literalblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre&gt;$ mkdir trader-stable.git
$ cd trader-stable.git
$ git init --bare
Initialized empty Git repository in /Users/Shared/trader-stable.git/
$&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Add Repository&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/4a49f571-4135-43a8-915f-e96db6eb902b&quot; alt=&quot;4a49f571 4135 43a8 915f e96db6eb902b&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;Repository URL&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/e33f505c-a52b-4752-83f9-44bf45b9db47&quot; alt=&quot;e33f505c a52b 4752 83f9 44bf45b9db47&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Advanced&amp;#8230;&amp;#8203;&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/507dc8b1-d86b-4cde-b24c-b59da15e84ed&quot; alt=&quot;507dc8b1 d86b 4cde b24c b59da15e84ed&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;stable&lt;/code&gt; to &lt;code&gt;Name&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/0f54d0a9-5317-40f5-9c60-ee13804a9904&quot; alt=&quot;0f54d0a9 5317 40f5 9c60 ee13804a9904&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Add post-build action&lt;/code&gt; &amp;#8658; &lt;code&gt;Git Publisher&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/44eeab12-4cf2-4c4a-81a9-785b99514659&quot; alt=&quot;44eeab12 4cf2 4c4a 81a9 785b99514659&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check &lt;code&gt;Push Only If Build Succeeds&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Add Tag&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/60946cca-e837-4245-a2c8-8e74c98c1f23&quot; alt=&quot;60946cca e837 4245 a2c8 8e74c98c1f23&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;$BUILD_NUMBER&lt;/code&gt; to &lt;code&gt;Tag to push&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check &lt;code&gt;Create new tag&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;stable&lt;/code&gt; to &lt;code&gt;Target remote name&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Save&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/2a9e7146-7663-414f-9499-91b65e028a43&quot; alt=&quot;2a9e7146 7663 414f 9499 91b65e028a43&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;_test&quot;&gt;Test&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;literalblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre&gt;$ pwd
/Users/kyle/tmp/trader
$ echo &apos;push if succeeds test&apos; &amp;gt;&amp;gt; hi.txt
$ git commit -am &apos;push if succeeds test&apos;
$ git push origin master&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Jenkins said &lt;code&gt;Pushing tag 8 to repo stable&lt;/code&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/3e1e0e9a-2732-4054-8a20-82da0f67a7ab&quot; alt=&quot;3e1e0e9a 2732 4054 8a20 82da0f67a7ab&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;literalblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre&gt;$ git remote add stable /Users/Shared/trader-stable.git
$ git fetch stable
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (1/1), done.
From /Users/Shared/trader-stable
 * [new tag]         8          -&amp;gt; 8
$&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/configuring-automatic-build-by-push</guid>
    <title>Configuring automatic build by push for git repository</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/configuring-automatic-build-by-push</link>
        <pubDate>Sun, 1 Mar 2015 10:15:39 +0000</pubDate>
    <category>Jenkins</category>
    <category>git</category>
    <category>jenkins</category>
            <description>&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;We can start the build by send request to following URL.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;literalblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre&gt;http://YOURHOST/jenkins/job/PROJECTNAME/build&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;_recipe&quot;&gt;Recipe&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;In my case, Jenkins is deployed in &lt;code&gt;/&lt;/code&gt;, and the server is running on port &lt;code&gt;18080&lt;/code&gt;. so the command to start a build of the job named &lt;code&gt;trader&lt;/code&gt; will be:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;literalblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre&gt;curl http://localhost:18080/job/trader/build&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;So put following shell script into &lt;code&gt;$ORIGIN_BARE_REPOSITORY/hooks/post-receive&lt;/code&gt; and execute &lt;code&gt;chmod +x post-receive&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;literalblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre&gt;#!/bin/sh
curl http://localhost:18080/job/trader/build&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;_testing&quot;&gt;Testing&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Push some modification as follows:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;literalblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;pre&gt;$ echo hook test &amp;gt;&amp;gt; hi.txt
$ git add hi.txt
$ git commit -m &apos;hook test&apos;
$ git push origin master&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;paragraph&quot;&gt;
&lt;p&gt;Check the build was run automatically as expected, and the output.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/b0731e82-30d0-4638-b412-1e1bba91d3c9&quot; alt=&quot;b0731e82 30d0 4638 b412 1e1bba91d3c9&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sect1&quot;&gt;
&lt;h2 id=&quot;_references&quot;&gt;References&lt;/h2&gt;
&lt;div class=&quot;sectionbody&quot;&gt;
&lt;div class=&quot;ulist&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-Configuringautomaticbuilds&quot; class=&quot;bare&quot;&gt;https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-Configuringautomaticbuilds&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/9653165/whats-the-difference-between-post-receive-and-post-update&quot; class=&quot;bare&quot;&gt;http://stackoverflow.com/questions/9653165/whats-the-difference-between-post-receive-and-post-update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/creating-a-simplest-jenkins-job</guid>
    <title>Creating a simplest Jenkins job against a git repository</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/creating-a-simplest-jenkins-job</link>
        <pubDate>Sun, 1 Mar 2015 08:45:55 +0000</pubDate>
    <category>Jenkins</category>
    <category>git</category>
    <category>jenkins</category>
            <description>&lt;div class=&quot;olist arabic&quot;&gt;
&lt;ol class=&quot;arabic&quot;&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;New Item&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/ecdf88ac-ba06-4f30-aaa6-889b72d7a6be&quot; alt=&quot;ecdf88ac ba06 4f30 aaa6 889b72d7a6be&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;trader&lt;/code&gt; in &lt;code&gt;Item name&lt;/code&gt; and select &lt;code&gt;Build a free-style software project&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/81952af0-a4ae-40d7-a387-e02647d31f23&quot; alt=&quot;81952af0 a4ae 40d7 a387 e02647d31f23&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;code&gt;Git&lt;/code&gt; and enter &lt;code&gt;Repository URL&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/9ac2c2af-2a4a-4b4d-90b4-7eed0a73433e&quot; alt=&quot;9ac2c2af 2a4a 4b4d 90b4 7eed0a73433e&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Add build step&lt;/code&gt; - &lt;code&gt;Execute shell&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/dc7e02f0-9e6f-47ed-8049-e7a1a3078c11&quot; alt=&quot;dc7e02f0 9e6f 47ed 8049 e7a1a3078c11&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;cat hi.txt&lt;/code&gt; into &lt;code&gt;Command&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/95537b80-e9a0-4e42-89df-d8dfb548de90&quot; alt=&quot;95537b80 e9a0 4e42 89df d8dfb548de90&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Save&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/659ed88d-0455-400c-91e4-f4b3ab714ea3&quot; alt=&quot;659ed88d 0455 400c 91e4 f4b3ab714ea3&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Build Now&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/9d4ef446-7b26-4a7a-a2a2-010268e05e84&quot; alt=&quot;9d4ef446 7b26 4a7a a2a2 010268e05e84&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click a Build History which just created by build&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/44f32959-4d18-4a89-8895-c35c1861be51&quot; alt=&quot;44f32959 4d18 4a89 8895 c35c1861be51&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;code&gt;Console Output&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;imageblock&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;img src=&quot;/roller/kyle/mediaresource/f3da0b60-f9a2-4963-a12f-4fc3a8c1f392&quot; alt=&quot;f3da0b60 f9a2 4963 a12f 4fc3a8c1f392&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/articles-jenkins-proddeploy</guid>
    <title>Deploying after integration test with Jenkins</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/articles-jenkins-proddeploy</link>
        <pubDate>Wed, 5 Mar 2014 07:09:35 +0000</pubDate>
    <category>Jenkins</category>
    <category>jenkins</category>
            <description>&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I want to deploy the production resource after integration test.&lt;/li&gt;
&lt;li&gt;But some resources are environment-specific.&lt;/li&gt;
&lt;li&gt;So, after integration test succeeded, I want to replace such resources for production version.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;How to achieve it?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The deployment job is need to be a parameterized job.&lt;/li&gt;
&lt;li&gt;After integration test completed, then another mvn starts at post-build step of Jenkins.&lt;ul&gt;
&lt;li&gt;This mvn does only package goal with no tests.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Deployment will be executed by SSH deploy plugin at post-build action of Jenkins.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;How to apply this way to a Jenkins job?&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Create a parameterized job that can integration-test and deployment be done successfully.&lt;ul&gt;
&lt;li&gt;I assumed a job similar to one created at another my posting &lt;a href=&quot;/roller/kyle/entry/articles-jenkins-sshdeploy&quot;&gt;Deploying with Publish Over SSH Plugin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Go to job configuration page&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Add post-build step&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Invoke top-level Maven targets&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Select &amp;ldquo;Run only if build succeeds&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Select Maven Version &amp;ldquo;Default&amp;rdquo;&lt;ul&gt;
&lt;li&gt;Not (Default) which one with enclosed in parentheses. it won&apos;t work.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;Goals&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Advanced&amp;hellip;&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;POM&amp;rdquo;, &amp;ldquo;Properties&amp;rdquo;. &lt;img src=&quot;/articles-img/jenkins/proddeploy/poststeps.png&quot; alt=&quot;&quot; /&gt;&lt;ul&gt;
&lt;li&gt;&amp;ldquo;hogeApp.environmentId=prod&amp;rdquo; triggers to Maven to include production resources in my pom.xml.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ensure that there is a post-build action which deploys the artifact to the production environment.&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Save&amp;rdquo; of bottom of the page.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Log&lt;/h2&gt;
&lt;h3&gt;Jenkins job output&lt;/h3&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
...
[INFO] --- maven-failsafe-plugin:2.16:verify (default) @ switch ---
[INFO] Failsafe report directory: /Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/target/failsafe-reports
[JENKINS] テスト結果の記録
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.169s
[INFO] Finished at: Wed Mar 05 16:25:53 JST 2014
[INFO] Final Memory: 22M/318M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/pom.xml to org.nailedtothex/switch/0.0.1-SNAPSHOT/switch-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/target/switch.war to org.nailedtothex/switch/0.0.1-SNAPSHOT/switch-0.0.1-SNAPSHOT.war
channel stopped
[workspace] $ /Users/kyle/apps/apache-maven-3.1.1/bin/mvn -f switch/pom.xml -Dtag=v0.1 -Dmaven.test.skip=true -DhogeApp.environmentId=prod clean package
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building switch 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ switch ---
[INFO] Deleting /Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ switch ---
[INFO] Using &apos;UTF-8&apos; encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ switch ---
[INFO] Compiling 1 source file to /Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ switch ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ switch ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ switch ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.4:war (default-war) @ switch ---
[INFO] Packaging webapp
[INFO] Assembling webapp [switch] in [/Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/target/switch]
[INFO] Processing war project
[INFO] Copying webapp webResources [/Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/src/main/webapp/_prod] to [/Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/target/switch]
[INFO] Copying webapp resources [/Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/src/main/webapp]
[INFO] Webapp assembled in [46 msecs]
[INFO] Building war: /Users/Shared/Jenkins/Home/jobs/SwitchDeploy/workspace/switch/target/switch.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.595s
[INFO] Finished at: Wed Mar 05 16:26:01 JST 2014
[INFO] Final Memory: 15M/245M
[INFO] ------------------------------------------------------------------------
SSH: Connecting from host [kyle-no-MacBook.local]
SSH: Connecting with configuration [osxserver] ...
SSH: EXEC: STDOUT/STDERR from command [/Users/kyle/wildfly-8.0.0.Final/bin/jboss-cli.sh --connect --controller=localhost:49990 --command=&amp;quot;deploy switch.war --force&amp;quot;] ...
SSH: EXEC: completed after 3,256 ms
SSH: Disconnecting configuration [osxserver] ...
SSH: Transferred 1 file(s)
Finished: SUCCESS
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Deployment succeeded as expectedly.&lt;/li&gt;
&lt;li&gt;After integration-test completed, another mvn was kicked, and it builds the package for production without testing once again.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Check the deployed application&lt;/h3&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kyle-osxserver:~ kyle$ telnet localhost 48080
Trying 127.0.0.1...
Connected to localhost.
Escape character is &apos;^]&apos;.
GET /switch/ HTTP/1.0

HTTP/1.0 200 OK
Connection: close
X-Powered-By: Undertow 1
X-Powered-By: JSP/2.2
Set-Cookie: JSESSIONID=gLpwDJ37tu-Uoxd0r9pWD2wH.kyle-osxserver; path=/switch
Server: Wildfly 8
Content-Type: text/plain;charset=UTF-8
Date: Wed, 05 Mar 2014 07:27:29 GMT

This value came from context-param defined in /src/main/webapp/_prod/WEB-INF/web.xml
This value came from /src/main/resources/common.properties
This value came from /src/main/resources/_prod/env-specific.properties
Connection closed by foreign host.
kyle-osxserver:~ kyle$ 
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;I deployed a sample application created in &lt;a href=&quot;/roller/kyle/entry/articles-maven-switch&quot;&gt;Maven - Switching environment specific configuration files&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I can see that pom.xml of it was included resources for production expectedly.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/13822913/jenkins-executing-maven-from-incorrect-path&quot;&gt;Jenkins executing maven from incorrect path - Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/7456006/maven-packaging-without-test-skip-tests&quot;&gt;java - Maven packaging without test (skip tests) - Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jenkins-ci.361315.n4.nabble.com/pre-build-maven-step-not-working-with-default-maven-td4667276.html&quot;&gt;Jenkins users - pre-build maven step not working with default maven?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://issues.jenkins-ci.org/browse/JENKINS-755&quot;&gt; [#JENKINS-755] Default JDK meaning in project options is confusing. - Jenkins JIRA&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/articles-jenkins-sshdeploy</guid>
    <title>Deploying with Jenkins Publish Over SSH Plugin</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/articles-jenkins-sshdeploy</link>
        <pubDate>Fri, 28 Feb 2014 00:28:23 +0000</pubDate>
    <category>Jenkins</category>
    <category>jenkins</category>
            <description>&lt;h2&gt;Environment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;WildFly 8.0.0.Final&lt;/li&gt;
&lt;li&gt;Publish Over SSH Plugin 1.11&lt;/li&gt;
&lt;li&gt;Jenkins 1.551&lt;/li&gt;
&lt;li&gt;OS X 10.9.2&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Resources are available in git repository&lt;/li&gt;
&lt;li&gt;The job is parametarized and can specify the tag to be processed&lt;/li&gt;
&lt;li&gt;The job will build a WAR and deploy it to the remote application server through ssh&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Install the plugin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Install &amp;ldquo;Publish Over SSH Plugin 1.11&amp;rdquo; at Plug-in page.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Create a key-pair&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kyle-no-MacBook:~ jenkins$ whoami
jenkins
kyle-no-MacBook:~ jenkins$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/Shared/Jenkins/.ssh/id_rsa): 
Created directory &apos;/Users/Shared/Jenkins/.ssh&apos;.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/Shared/Jenkins/.ssh/id_rsa.
Your public key has been saved in /Users/Shared/Jenkins/.ssh/id_rsa.pub.
The key fingerprint is:
[...] 
The key&apos;s randomart image is:
[...]
kyle-no-MacBook:~ jenkins$ ls -l .ssh
total 16
-rw-------  1 jenkins  jenkins  1679 Feb 28 11:55 id_rsa
-rw-r--r--  1 jenkins  jenkins   411 Feb 28 11:55 id_rsa.pub
kyle-no-MacBook:~ jenkins$ 
&lt;/pre&gt;&lt;h2&gt;Put the public-key to the server&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kyle-osxserver:.ssh kyle$ cat &amp;gt;&amp;gt; authorized_keys &amp;lt;&amp;lt; EOF
&amp;gt; ssh-rsa [...] jenkins@kyle-no-MacBook.local
&amp;gt; EOF
&lt;/pre&gt;&lt;h2&gt;Configure&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &amp;ldquo;Manage Jenkins&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Configure System&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Go to &amp;ldquo;Publish over SSH&amp;rdquo; section&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;/Users/Shared/Jenkins/.ssh/id_rsa&amp;rdquo; to &amp;ldquo;Path to Key&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Add&amp;rdquo; at &amp;ldquo;SSH Servers&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter any logical name to &amp;ldquo;Name&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter IP Address or Hostname of the server to &amp;ldquo;Hostname&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter the user name to login to &amp;ldquo;Username&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter any directory to &amp;ldquo;Remote Directory&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Test Configuration&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Save&amp;rdquo; at bottom of the page&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;/articles-img/jenkins/sshdeploy/config1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Create a job&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Create or copy a job that can build the WAR correctly.&lt;/li&gt;
&lt;li&gt;As I wrote in &lt;a href=&quot;/roller/kyle/entry/articles-jenkins-gittag&quot;&gt;How to specify a Git tag to be processed&lt;/a&gt;, make a job to can specify a tag to be processed.&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Add post-build action&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Send build artifacts over SSH&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;Source files&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;Remove prefix&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;Exec command&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;/articles-img/jenkins/sshdeploy/config2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;WildFly deploy command example:&lt;/p&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
/Users/kyle/wildfly-8.0.0.Final/bin/jboss-cli.sh --connect --controller=localhost:49990 --command=&amp;quot;deploy hoge-0.0.1-SNAPSHOT.war --force&amp;quot;
&lt;/pre&gt;&lt;h2&gt;Create a tag&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kyle-no-MacBook:stock kyle$ git tag v0.1
kyle-no-MacBook:stock kyle$ git tag
v0.1
kyle-no-MacBook:stock kyle$ git show v0.1
commit 87a93c8039bd77b8eb8cbf8fbb522705c6451f1e
[...]
&lt;/pre&gt;&lt;h2&gt;Run&lt;/h2&gt;
&lt;p&gt;Run the job that created with the parameter of name of tag.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click &amp;ldquo;Build with Parameters&amp;rdquo; &lt;img src=&quot;/articles-img/jenkins/sshdeploy/run1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select a tag to be processed and Click &amp;ldquo;Build&amp;rdquo; &lt;img src=&quot;/articles-img/jenkins/sshdeploy/run2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Log&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
...
[JENKINS] Archiving /Users/Shared/Jenkins/Home/jobs/HogeDeploy/workspace/hoge/pom.xml to org.nailedtothex/hoge/0.0.1-SNAPSHOT/hoge-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /Users/Shared/Jenkins/Home/jobs/HogeDeploy/workspace/hoge/target/hoge-0.0.1-SNAPSHOT.war to org.nailedtothex/hoge/0.0.1-SNAPSHOT/hoge-0.0.1-SNAPSHOT.war
channel stopped
SSH: Connecting from host [kyle-no-MacBook.local]
SSH: Connecting with configuration [osxserver] ...
SSH: EXEC: STDOUT/STDERR from command [/Users/kyle/wildfly-8.0.0.Final/bin/jboss-cli.sh --connect --controller=localhost:49990 --command=&amp;quot;deploy /Users/kyle/hoge-0.0.1-SNAPSHOT.war --force&amp;quot;] ...
SSH: EXEC: completed after 4,357 ms
SSH: Disconnecting configuration [osxserver] ...
SSH: Transferred 1 file(s)
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: kyle@example.com
Finished: SUCCESS
&lt;/pre&gt;&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over&quot;&gt;Publish Over - Jenkins - Jenkins Wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://d.hatena.ne.jp/hase5021/20130513/1368426489&quot;&gt;jenkinsによるWebSphereへのEARファイルデプロイ - 遅れてやってきたプログラマーの小言&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://d.hatena.ne.jp/gnarl/20111122/1321938292&quot;&gt;Jenkins、Webから再起動する&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://git-scm.com/book/ja/Git-の基本-タグ&quot;&gt;Git - タグ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://planet.jboss.org/post/deploy_to_wildfly_using_jboss_cli_tech_tip_11&quot;&gt;Deploy to WildFly using jboss-cli (Tech Tip #11) | Miles to go 2.0 &amp;hellip; | Planet JBoss Community&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/articles-jenkins-poll</guid>
    <title>How to make a Jenkins job to poll SCM periodically</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/articles-jenkins-poll</link>
        <pubDate>Sun, 23 Feb 2014 02:11:17 +0000</pubDate>
    <category>Jenkins</category>
    <category>jenkins</category>
            <description>&lt;h2&gt;Environment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Jenkins 1.551&lt;/li&gt;
&lt;li&gt;git version 1.8.3.4 (Apple Git-47)&lt;/li&gt;
&lt;li&gt;OS X 10.9.1&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Why need it?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;As I wrote in &lt;a href=&quot;/roller/kyle/entry/articles-jenkins-gittrigger&quot;&gt;How to make git commit to trigger run a Jenkins job&lt;/a&gt;, Git plugin of Eclipse doesn&apos;t fire hooks.&lt;ul&gt;
&lt;li&gt;Unfortunately, currently EGit not supported it, and maybe will not[1].&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;So we need an alternative way, such as make Jenkins to poll SCM periodically.&lt;ul&gt;
&lt;li&gt;It seems to I can configure it easily so I just try it here.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;How to configure&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Go to configure page of a project.&lt;/li&gt;
&lt;li&gt;Go to &amp;ldquo;Build Triggers&amp;rdquo; section.&lt;/li&gt;
&lt;li&gt;Check &amp;ldquo;Poll SCM&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter the schedule that you want in cron-style.&lt;ul&gt;
&lt;li&gt;The help that placed side of input area might be useful&lt;/li&gt;
&lt;li&gt;Example for poll at every 15minutes is here: &lt;img src=&quot;/articles-img/jenkins/poll/poll.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;See the log&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;When any change is detected at polling, we can see that message in log of Jenkins.&lt;ul&gt;
&lt;li&gt;In this setup, the log file is located at /var/log/jenkins/jenkins.log&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
Feb 23, 2014 11:24:45 AM hudson.triggers.SCMTrigger$Runner run
情報: SCM changes detected in BuildAndTestHead. Triggering  #22
Feb 23, 2014 11:24:57 AM hudson.model.Run execute
情報: BuildAndTestHead #22 main build action completed: SUCCESS
&lt;/pre&gt;&lt;h2&gt;Remarks&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I&apos;m not sure that CPU usage or any other resource consumption of git polling.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://www.eclipse.org/forums/index.php/t/237571/&quot;&gt;Eclipse Community Forums: EGit » Enabling hooks in EGit&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/articles-jenkins-email</guid>
    <title>How to send Email at every build with Jenkins</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/articles-jenkins-email</link>
        <pubDate>Sat, 22 Feb 2014 12:34:59 +0000</pubDate>
    <category>Jenkins</category>
    <category>jenkins</category>
            <description>&lt;h2&gt;Environment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Email-ext plugin 2.37.2&lt;/li&gt;
&lt;li&gt;Jenkins 1.551&lt;/li&gt;
&lt;li&gt;Apache Maven 3.1.1&lt;/li&gt;
&lt;li&gt;git version 1.8.3.4 (Apple Git-47)&lt;/li&gt;
&lt;li&gt;Oracle JDK7u51&lt;/li&gt;
&lt;li&gt;OS X 10.9.1&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Install Email-ext plugin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Install Email-ext plugin at plug-in install page of Jenkins&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Configure System&lt;/h2&gt;
&lt;h3&gt;&amp;ldquo;Jenkins Location&amp;rdquo; section&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Enter valid email address to &amp;ldquo;System Admin e-mail address&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;&amp;ldquo;Extended E-mail Notification&amp;rdquo; section&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Enter your email address to &amp;ldquo;Default Recipients&amp;rdquo; &lt;img src=&quot;/articles-img/jenkins/email/extended.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;&amp;ldquo;E-mail Notification&amp;rdquo; section&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Enter your SMTP server name to &amp;ldquo;SMTP server&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Advanced&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Use SMTP Authentication&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter required informations &lt;img src=&quot;/articles-img/jenkins/email/emailconfig.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Check &amp;ldquo;Test configuration by sending test e-mail&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Test configuration&amp;rdquo; to send test email&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Save&amp;rdquo; in the bottom of the page&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Configure a project to send email at every build&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &amp;ldquo;Add post-build action&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Editable Email Notification&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Advanced Settings&amp;hellip;&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Add Trigger&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Always&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Save&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Test-run&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &amp;ldquo;Build Now&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Check Console output and received email&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.497s
[INFO] Finished at: Sat Feb 22 22:27:21 JST 2014
[INFO] Final Memory: 18M/245M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /Users/Shared/Jenkins/Home/jobs/BuildAndTestHead/workspace/hellojenkins/pom.xml to org.nailedtothex/hellojenkins/0.0.1-SNAPSHOT/hellojenkins-0.0.1-SNAPSHOT.pom
channel stopped
Archiving artifacts
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: kyle@example.com
Finished: SUCCESS
&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;/articles-img/jenkins/email/email.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin&quot;&gt;Email-ext plugin - Jenkins - Jenkins Wiki&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/articles-jenkins-deploy</guid>
    <title>How to deploy an application to WildFly with wildfly-maven-plugin</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/articles-jenkins-deploy</link>
        <pubDate>Fri, 21 Feb 2014 23:39:59 +0000</pubDate>
    <category>Jenkins</category>
    <category>jenkins</category>
    <category>maven</category>
    <category>wildfly</category>
            <description>&lt;h2&gt;Environment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Jenkins 1.551&lt;/li&gt;
&lt;li&gt;Apache Maven 3.1.1&lt;/li&gt;
&lt;li&gt;git version 1.8.3.4 (Apple Git-47)&lt;/li&gt;
&lt;li&gt;Oracle JDK7u51&lt;/li&gt;
&lt;li&gt;OS X 10.9.1&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Consideration of a way to achieve&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;There&apos;s the Deploy Plugin of Jenkins, but it only listed JBoss 5.x&lt;/li&gt;
&lt;li&gt;Thus, I&apos;m going to do deploy through Maven goal with wildfly-maven-plugin, not Jenkins Plugin.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Make pom.xml can deploy&lt;/h2&gt;
&lt;h3&gt;Add wildfly-maven-plugin to pom.xml&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;According to [1], we need plugin definition like that.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;org.wildfly.plugins&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;wildfly-maven-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;1.0.1.Final&amp;lt;/version&amp;gt;
            &amp;lt;/plugin&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;My whole pom.xml is:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
&amp;lt;project xmlns=&amp;quot;http://maven.apache.org/POM/4.0.0&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
    xsi:schemaLocation=&amp;quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&amp;quot;&amp;gt;
    &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;
    &amp;lt;groupId&amp;gt;org.nailedtothex&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;hellojenkins&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;
    &amp;lt;packaging&amp;gt;war&amp;lt;/packaging&amp;gt;
    &amp;lt;dependencies&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;javaee-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;7.0&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;4.11&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
    &amp;lt;/dependencies&amp;gt;
    &amp;lt;properties&amp;gt;
        &amp;lt;maven.compiler.source&amp;gt;1.7&amp;lt;/maven.compiler.source&amp;gt;
        &amp;lt;maven.compiler.target&amp;gt;1.7&amp;lt;/maven.compiler.target&amp;gt;
        &amp;lt;failOnMissingWebXml&amp;gt;false&amp;lt;/failOnMissingWebXml&amp;gt;
    &amp;lt;/properties&amp;gt;
    &amp;lt;build&amp;gt;
        &amp;lt;plugins&amp;gt;
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;org.wildfly.plugins&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;wildfly-maven-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;1.0.1.Final&amp;lt;/version&amp;gt;
            &amp;lt;/plugin&amp;gt;
        &amp;lt;/plugins&amp;gt;
    &amp;lt;/build&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;&lt;h3&gt;Run mvn to deploy&lt;/h3&gt;
&lt;p&gt;According to [1], deploy command is:&lt;/p&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
mvn wildfly:deploy
&lt;/pre&gt;&lt;p&gt;Let&apos;s try&lt;/p&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kyle-no-MacBook:hellojenkins kyle$ mvn clean package wildfly:deploy
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building hellojenkins 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hellojenkins ---
[INFO] Deleting /Users/kyle/gits1/hellojenkins/hellojenkins/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hellojenkins ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hellojenkins ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /Users/kyle/gits1/hellojenkins/hellojenkins/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hellojenkins ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/kyle/gits1/hellojenkins/hellojenkins/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ hellojenkins ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/kyle/gits1/hellojenkins/hellojenkins/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hellojenkins ---
[INFO] Surefire report directory: /Users/kyle/gits1/hellojenkins/hellojenkins/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
Running hellojenkins.HelloBeanTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.043 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ hellojenkins ---
[INFO] Packaging webapp
[INFO] Assembling webapp [hellojenkins] in [/Users/kyle/gits1/hellojenkins/hellojenkins/target/hellojenkins-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/kyle/gits1/hellojenkins/hellojenkins/src/main/webapp]
[INFO] Webapp assembled in [19 msecs]
[INFO] Building war: /Users/kyle/gits1/hellojenkins/hellojenkins/target/hellojenkins-0.0.1-SNAPSHOT.war
[INFO] 
[INFO] &amp;gt;&amp;gt;&amp;gt; wildfly-maven-plugin:1.0.1.Final:deploy (default-cli) @ hellojenkins &amp;gt;&amp;gt;&amp;gt;
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hellojenkins ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hellojenkins ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hellojenkins ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/kyle/gits1/hellojenkins/hellojenkins/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ hellojenkins ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hellojenkins ---
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ hellojenkins ---
[INFO] Packaging webapp
[INFO] Assembling webapp [hellojenkins] in [/Users/kyle/gits1/hellojenkins/hellojenkins/target/hellojenkins-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/kyle/gits1/hellojenkins/hellojenkins/src/main/webapp]
[INFO] Webapp assembled in [5 msecs]
[INFO] Building war: /Users/kyle/gits1/hellojenkins/hellojenkins/target/hellojenkins-0.0.1-SNAPSHOT.war
[INFO] 
[INFO] &amp;lt;&amp;lt;&amp;lt; wildfly-maven-plugin:1.0.1.Final:deploy (default-cli) @ hellojenkins &amp;lt;&amp;lt;&amp;lt;
[INFO] 
[INFO] --- wildfly-maven-plugin:1.0.1.Final:deploy (default-cli) @ hellojenkins ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.5/commons-compress-1.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.5/commons-compress-1.5.pom (11 KB at 1.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/28/commons-parent-28.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/28/commons-parent-28.pom (49 KB at 94.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/tukaani/xz/1.2/xz-1.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/tukaani/xz/1.2/xz-1.2.pom (2 KB at 7.3 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-core/3.0.5/maven-core-3.0.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-core/3.0.5/maven-core-3.0.5.pom (6 KB at 20.6 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.pom
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.pom (4 KB at 11.2 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.5/commons-compress-1.5.jar
Downloading: http://repo.maven.apache.org/maven2/org/tukaani/xz/1.2/xz-1.2.jar
Downloading: http://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.jar
Downloading: http://repo.maven.apache.org/maven2/org/jboss/remoting/jboss-remoting/4.0.0.Final/jboss-remoting-4.0.0.Final.jar
Downloaded: http://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar (28 KB at 37.5 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/jboss/xnio/xnio-api/3.2.0.Final/xnio-api-3.2.0.Final.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.5/commons-compress-1.5.jar (251 KB at 252.3 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/jboss/xnio/xnio-nio/3.2.0.Final/xnio-nio-3.2.0.Final.jar
Downloaded: http://repo.maven.apache.org/maven2/org/tukaani/xz/1.2/xz-1.2.jar (93 KB at 83.0 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.jar (226 KB at 157.5 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/jboss/xnio/xnio-nio/3.2.0.Final/xnio-nio-3.2.0.Final.jar (95 KB at 149.7 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/jboss/xnio/xnio-api/3.2.0.Final/xnio-api-3.2.0.Final.jar (480 KB at 162.2 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/jboss/remoting/jboss-remoting/4.0.0.Final/jboss-remoting-4.0.0.Final.jar
Downloaded: http://repository.jboss.org/nexus/content/groups/public/org/jboss/remoting/jboss-remoting/4.0.0.Final/jboss-remoting-4.0.0.Final.jar (256 KB at 57.1 KB/sec)
2 22, 2014 10:07:18 午前 org.xnio.Xnio &amp;lt;clinit&amp;gt;
INFO: XNIO version 3.2.0.Final
2 22, 2014 10:07:19 午前 org.xnio.nio.NioXnio &amp;lt;clinit&amp;gt;
INFO: XNIO NIO Implementation Version 3.2.0.Final
2 22, 2014 10:07:19 午前 org.jboss.remoting3.EndpointImpl &amp;lt;clinit&amp;gt;
INFO: JBoss Remoting version 4.0.0.Final
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.107s
[INFO] Finished at: Sat Feb 22 10:07:19 JST 2014
[INFO] Final Memory: 20M/245M
[INFO] ------------------------------------------------------------------------
kyle-no-MacBook:hellojenkins kyle$ 
&lt;/pre&gt;&lt;p&gt;Log of running WildFly:&lt;/p&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
10:07:19,623 INFO  [org.jboss.as.repository] (management-handler-thread - 13) JBAS014900: Content added at location /Users/kyle/apps/wildfly-8.0.0.Final/standalone/data/content/74/0b98a41a3c0830172a5df0c5c8d5fdc42be9b6/content
10:07:19,627 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015876: Starting deployment of &amp;quot;hellojenkins-0.0.1-SNAPSHOT.war&amp;quot; (runtime-name: &amp;quot;hellojenkins-0.0.1-SNAPSHOT.war&amp;quot;)
10:07:19,649 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment hellojenkins-0.0.1-SNAPSHOT.war
10:07:19,661 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: hellojenkins-0.0.1-SNAPSHOT.war
10:07:19,666 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment hellojenkins-0.0.1-SNAPSHOT.war
10:07:19,811 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) JBAS017534: Registered web context: /hellojenkins-0.0.1-SNAPSHOT
10:07:19,832 INFO  [org.jboss.as.server] (management-handler-thread - 13) JBAS018559: Deployed &amp;quot;hellojenkins-0.0.1-SNAPSHOT.war&amp;quot; (runtime-name : &amp;quot;hellojenkins-0.0.1-SNAPSHOT.war&amp;quot;)
&lt;/pre&gt;&lt;p&gt;The application works: &lt;img src=&quot;/articles-img/jenkins/deploy/hello.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This works too if there&apos;s application already deployed which have same name.&lt;/p&gt;
&lt;h2&gt;Commit to repository&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Commit changes of pom.xml so that Jenkins can execute the goal that tested above.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Make a Jenkins job&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Copy a job that created in &lt;a href=&quot;/roller/kyle/entry/articles-jenkins-hello&quot;&gt;previous post&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Edit the job that copied&lt;ul&gt;
&lt;li&gt;Add maven goal &amp;ldquo;wildfly:deploy&amp;rdquo; &lt;img src=&quot;/articles-img/jenkins/deploy/deploygoal.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;保存&amp;rdquo; in the bottom of the page&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Run the job&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I got some errors.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
[INFO] XNIO version 3.2.0.Final
[INFO] XNIO NIO Implementation Version 3.2.0.Final
[INFO] JBoss Remoting version 4.0.0.Final
Authenticating against security realm: ManagementRealm
[ERROR] JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: the server presented no authentication mechanisms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 48.038s
[INFO] Finished at: Sat Feb 22 13:44:10 JST 2014
[INFO] Final Memory: 20M/249M
[INFO] ------------------------------------------------------------------------
Jenkins????????????????
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.1.Final:deploy (default-cli) on project hellojenkins: Could not execute goal deploy on /Users/Shared/Jenkins/Home/jobs/DeployToWildFly/workspace/hellojenkins/target/hellojenkins-0.0.1-SNAPSHOT.war. Reason: I/O Error could not execute operation &apos;{
[ERROR] &amp;quot;operation&amp;quot; =&amp;gt; &amp;quot;read-attribute&amp;quot;,
[ERROR] &amp;quot;address&amp;quot; =&amp;gt; [],
[ERROR] &amp;quot;name&amp;quot; =&amp;gt; &amp;quot;launch-type&amp;quot;
[ERROR] }&apos;: java.net.ConnectException: JBAS012174: Could not connect to http-remoting://127.0.0.1:9990. The connection failed: Authentication failed: the server presented no authentication mechanisms
[JENKINS] Archiving /Users/Shared/Jenkins/Home/jobs/DeployToWildFly/workspace/hellojenkins/pom.xml to org.nailedtothex/hellojenkins/0.0.1-SNAPSHOT/hellojenkins-0.0.1-SNAPSHOT.pom
[ERROR] -&amp;gt; [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
channel stopped
成果物を保存中
Finished: FAILURE
&lt;/pre&gt;&lt;h3&gt;Why error?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;In this setup, Jenkins and WildFly are running in different users&lt;/li&gt;
&lt;li&gt;According to [7], there&apos;s an authentication mechanism called &amp;ldquo;JBoss Local User&amp;rdquo;, and maybe it can be used with same machine and user, and we might have been used it&lt;/li&gt;
&lt;li&gt;But Jenkins has its own user in this setup&lt;/li&gt;
&lt;li&gt;So, we may need another authentication mechanism.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Add a management user to WildFly&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;According to [7], properties file based authentication is enabled by default&lt;/li&gt;
&lt;li&gt;We can use that command named &amp;ldquo;add-user&amp;rdquo; in $WILDFLY_HOME/bin to add a pair of username and password to properties file. usage:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
./add-user.sh [USERNAME] [PASSWORD]
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;So let&apos;s make it one:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kyle-no-MacBook:bin kyle$ ./add-user.sh admin ***
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
Added user &apos;admin&apos; to file &apos;/Users/kyle/apps/wildfly-8.0.0.Final/standalone/configuration/mgmt-users.properties&apos;
Added user &apos;admin&apos; to file &apos;/Users/kyle/apps/wildfly-8.0.0.Final/domain/configuration/mgmt-users.properties&apos;
kyle-no-MacBook:bin kyle$
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Restart of WildFly is not mandatory.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Edit and commit pom.xml&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;We have to add configuration element as a child of plugin element&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
                &amp;lt;configuration&amp;gt;
                    &amp;lt;username&amp;gt;USERNAME&amp;lt;/username&amp;gt;
                    &amp;lt;password&amp;gt;PASSWORD&amp;lt;/password&amp;gt;
                &amp;lt;/configuration&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Now it is:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
&amp;lt;project xmlns=&amp;quot;http://maven.apache.org/POM/4.0.0&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
    xsi:schemaLocation=&amp;quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&amp;quot;&amp;gt;
    &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;
    &amp;lt;groupId&amp;gt;org.nailedtothex&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;hellojenkins&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;
    &amp;lt;packaging&amp;gt;war&amp;lt;/packaging&amp;gt;
    &amp;lt;dependencies&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;javax&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;javaee-api&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;7.0&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;4.11&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
    &amp;lt;/dependencies&amp;gt;
    &amp;lt;properties&amp;gt;
        &amp;lt;maven.compiler.source&amp;gt;1.7&amp;lt;/maven.compiler.source&amp;gt;
        &amp;lt;maven.compiler.target&amp;gt;1.7&amp;lt;/maven.compiler.target&amp;gt;
        &amp;lt;failOnMissingWebXml&amp;gt;false&amp;lt;/failOnMissingWebXml&amp;gt;
    &amp;lt;/properties&amp;gt;
    &amp;lt;build&amp;gt;
        &amp;lt;plugins&amp;gt;
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;org.wildfly.plugins&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;wildfly-maven-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;1.0.1.Final&amp;lt;/version&amp;gt;
                &amp;lt;configuration&amp;gt;
                    &amp;lt;username&amp;gt;USERNAME&amp;lt;/username&amp;gt;
                    &amp;lt;password&amp;gt;PASSWORD&amp;lt;/password&amp;gt;
                &amp;lt;/configuration&amp;gt;
            &amp;lt;/plugin&amp;gt;
        &amp;lt;/plugins&amp;gt;
    &amp;lt;/build&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;After edit, we have to commit it again.&lt;/li&gt;
&lt;li&gt;I guess it is not good to write that environment specific variables like username and password in pom.xml, but I couldn&apos;t be found other better idea, so I just go this way this time.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;A way to specify that username and password in the MAVEN_OPTS&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;According to [10], entries that wrote &amp;ldquo;User property is:&amp;rdquo; are can be specified in the MAVEN_OPTS. like that: &lt;img src=&quot;/articles-img/jenkins/deploy/mavenoptsauth.png&quot; alt=&quot;&quot; /&gt;&lt;ul&gt;
&lt;li&gt;That configuration can be set after click &amp;ldquo;Advanced&amp;hellip;&amp;rdquo; in the build section of configuration page of a project.&lt;/li&gt;
&lt;li&gt;Now, we don&apos;t need to specify authentication information in pom.xml.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Run the job again&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
[INFO] --- maven-war-plugin:2.2:war (default-war) @ hellojenkins ---
[INFO] Packaging webapp
[INFO] Assembling webapp [hellojenkins] in [/Users/Shared/Jenkins/Home/jobs/DeployToWildFly/workspace/hellojenkins/target/hellojenkins-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Webapp assembled in [3 msecs]
[INFO] Building war: /Users/Shared/Jenkins/Home/jobs/DeployToWildFly/workspace/hellojenkins/target/hellojenkins-0.0.1-SNAPSHOT.war
[WARNING] Failed to getClass for org.wildfly.plugin.deployment.DeployMojo
[INFO] 
[INFO] &amp;lt;&amp;lt;&amp;lt; wildfly-maven-plugin:1.0.1.Final:deploy (default-cli) @ hellojenkins &amp;lt;&amp;lt;&amp;lt;
[INFO] 
[INFO] --- wildfly-maven-plugin:1.0.1.Final:deploy (default-cli) @ hellojenkins ---
[INFO] XNIO version 3.2.0.Final
[INFO] XNIO NIO Implementation Version 3.2.0.Final
[INFO] JBoss Remoting version 4.0.0.Final
Authenticating against security realm: ManagementRealm
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.672s
[INFO] Finished at: Sat Feb 22 14:37:01 JST 2014
[INFO] Final Memory: 21M/317M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /Users/Shared/Jenkins/Home/jobs/DeployToWildFly/workspace/hellojenkins/pom.xml to org.nailedtothex/hellojenkins/0.0.1-SNAPSHOT/hellojenkins-0.0.1-SNAPSHOT.pom
channel stopped
成果物を保存中
Finished: SUCCESS
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Succeed but weird warning &amp;ldquo;Failed to getClass for org.wildfly.plugin.deployment.DeployMojo&amp;rdquo; remained.&lt;ul&gt;
&lt;li&gt;I have googled it but there&apos;s no information about it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Remarks&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Maybe a way introduced at [8] can be a good idea to achieve that switch various deployment destinations.&lt;ul&gt;
&lt;li&gt;We can switch the destination easily through use of Maven profiles&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If you don&apos;t want to deploy when test failed, follow steps in [9] , and set parameter &amp;ldquo;-Dmaven.test.failure.ignore=false&amp;rdquo; to the MAVEN_OPTS.&lt;/li&gt;
&lt;li&gt;When we have to deploy to remote Unix systems, Publish Over SSH Plugin[11] sounds very useful than the procedure of this post.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.jboss.org/wildfly/plugins/maven/latest/examples/deployment-example.html&quot;&gt;WildFly Maven Plugin - Deploy/Undeploy Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.eclipse.org/forums/index.php/t/496232/&quot;&gt;Eclipse Community Forums: Hudson » Deploy to Wildfly (jBoss 8.x?)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://projectmanagernews.com/general/most-important-projects-codehaus/&quot;&gt;The 10 Most Important Projects Hosted On Codehaus.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin&quot;&gt;Deploy Plugin - Jenkins - Jenkins Wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://d.hatena.ne.jp/irof/20130528/p1&quot;&gt;JenkinsでJBossAS7にデプロイしようと思ったので - 日々常々&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.jboss.org/wildfly/plugins/maven/latest/examples/deployment-example.html&quot;&gt;WildFly Maven Plugin - Deploy/Undeploy Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.jboss.org/author/display/WFLY8/Security+Realms&quot;&gt;Security Realms - WildFly 8 - Project Documentation Editor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://lauraliparulo.altervista.org/jboss-wildfly-maven-plugin-to-deploy-on-localhostremote-server/&quot;&gt;Jboss / Wildfly maven plugin to deploy on localhost/remote server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://issues.jenkins-ci.org/browse/JENKINS-959&quot;&gt; [#JENKINS-959] hudson deploys maven artifact even if test has failed - Jenkins JIRA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.jboss.org/wildfly/plugins/maven/latest/deploy-mojo.html&quot;&gt;WildFly Maven Plugin - wildfly:deploy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin&quot;&gt;Publish Over SSH Plugin - Jenkins - Jenkins Wiki&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>          </item>
    <item>
    <guid isPermaLink="true">https://nozaki.me/roller/kyle/entry/articles-jenkins-gittag</guid>
    <title>How to specify a Git tag to be processed with Jenkins</title>
    <dc:creator>Kohei Nozaki</dc:creator>
    <link>https://nozaki.me/roller/kyle/entry/articles-jenkins-gittag</link>
        <pubDate>Fri, 21 Feb 2014 11:35:19 +0000</pubDate>
    <category>Jenkins</category>
    <category>jenkins</category>
            <description>&lt;h2&gt;Environment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Jenkins 1.551&lt;/li&gt;
&lt;li&gt;Apache Maven 3.1.1&lt;/li&gt;
&lt;li&gt;git version 1.8.3.4 (Apple Git-47)&lt;/li&gt;
&lt;li&gt;Eclipse Kepler SR1&lt;/li&gt;
&lt;li&gt;Oracle JDK7u51&lt;/li&gt;
&lt;li&gt;OS X 10.9.1&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Create a tag&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open context menu of the project - Team - Advanced - Tag &lt;img src=&quot;/articles-img/jenkins/gittag/tag.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter tag name and Tag message, then click OK &lt;img src=&quot;/articles-img/jenkins/gittag/tag2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To check created tag, Open context menu of the project - Team - Show in Repositories View &lt;img src=&quot;/articles-img/jenkins/gittag/tag3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Confirm it appeared. &lt;img src=&quot;/articles-img/jenkins/gittag/tag4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Modify a resource of HEAD&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;In order to check that build will processed with the tag specified, so just do some modify a resource of HEAD.&lt;ul&gt;
&lt;li&gt;Make sure that you are in the master branch.&lt;/li&gt;
&lt;li&gt;Procedure to switch: Team - Switch To - master&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I have modified a resource that returns a message to Servlet. now it shows like that: &lt;img src=&quot;/articles-img/jenkins/gittag/head.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;li&gt;After modify, we have to commit it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Install Git Parameter Plugin&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;I got trouble that the plugin not showing any tags, so I have stopped using this plugin. there are some people who reporting same problem[6].&lt;/strong&gt; If skipped this, we can&apos;t see the list of tags in the repository, but we can specify a tag manually.&lt;/p&gt;
&lt;p&gt;This plugin makes easy that specify a tag to be processed.&lt;/p&gt;
&lt;h2&gt;Make a Jenkins job&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Copy a job that created in &lt;a href=&quot;/roller/kyle/entry/articles-jenkins-deploy&quot;&gt;previous post&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Check &amp;ldquo;This build is parameterized&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Add Parameter&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Git Parameter&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;tag&amp;rdquo; to &amp;ldquo;Name&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;*/master&amp;rdquo; to &amp;ldquo;Branch&amp;rdquo; &lt;img src=&quot;/articles-img/jenkins/gittag/param1.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Find the section named &amp;ldquo;Source Code Management&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;${tag}&amp;rdquo; to &amp;ldquo;Branch Specifier&amp;rdquo; &lt;img src=&quot;/articles-img/jenkins/gittag/param2.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;Save&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Try Parameterized build&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click this: &lt;img src=&quot;/articles-img/jenkins/gittag/pbuild.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Select a tag that created above &lt;img src=&quot;/articles-img/jenkins/gittag/selecttag.png&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Click &amp;ldquo;ビルド&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Check console output of Jenkins&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
ユーザーanonymousが実行
ビルドします。 ワークスペース: /Users/Shared/Jenkins/Home/jobs/DeploySpecifiedTag/workspace
Fetching changes from the remote Git repository
Fetching upstream changes from file:///Users/kyle/gits1/hellojenkins
Checking out Revision 9d88b2abe381c6e2c915bbbf0ddeec09119b6f04 (v1.0)
Parsing POMs
...
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;We can see that build was processed with tag named &amp;ldquo;v1.0&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/7157170/can-i-get-jenkins-to-build-a-git-tag-from-a-passed-in-parameter&quot;&gt;Can I get Jenkins to build a git tag from a passed in parameter? - Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.sourceprojects.org/jenkins-and-the-git-branch-selection&quot;&gt;Jenkins and the Git Branch Selection - Sourceprojects.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin&quot;&gt;Git Parameter Plugin - Jenkins - Jenkins Wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://yuroyoro.hatenablog.com/entry/2012/12/20/175205&quot;&gt;Jenkinsで外部パラメータで与えたブランチを対象にビルドできるようにしておくと凄惨性あがって墓ドル - ( ꒪⌓꒪) ゆるよろ日記&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://unicus.jp/skmk/archives/361&quot;&gt;Hudson Growl Pluginでビルド結果をGrowlへ通知 | skmks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/lukanus/git-parameter/issues/2&quot;&gt;Doesn&apos;t show any tags or revisions · Issue #2 · lukanus/git-parameter&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>          </item>
  </channel>
</rss>