<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">

<channel>
	<title>Kohsuke Kawaguchi</title>
	
	<link>http://kohsuke.org</link>
	<description>Personal website of Kohsuke Kawaguchi</description>
	<lastBuildDate>Sun, 29 Apr 2012 14:14:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<copyright>Copyright © Kohsuke Kawaguchi 2010 </copyright>
	<managingEditor>kk@kohsuke.org (Kohsuke Kawaguchi)</managingEditor>
	<webMaster>kk@kohsuke.org (Kohsuke Kawaguchi)</webMaster>
	<image>
		<url>http://kohsuke.org/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Kohsuke Kawaguchi</title>
		<link>http://kohsuke.org</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle />
	<itunes:summary>Personal website of Kohsuke Kawaguchi</itunes:summary>
	<itunes:keywords />
	<itunes:category text="Society &amp; Culture" />
	<itunes:author>Kohsuke Kawaguchi</itunes:author>
	<itunes:owner>
		<itunes:name>Kohsuke Kawaguchi</itunes:name>
		<itunes:email>kk@kohsuke.org</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://kohsuke.org/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/kohsuke" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="kohsuke" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">kohsuke</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>POTD: Groovy Sandbox</title>
		<link>http://kohsuke.org/2012/04/29/potd-groovy-sandbox/</link>
		<comments>http://kohsuke.org/2012/04/29/potd-groovy-sandbox/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 14:05:02 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[potd]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=129</guid>
		<description><![CDATA[TweetI posted the other day about Groovy&#8217;s SecureASTCustomizer and how it is harmful. In the end of that post, I suggested that doing the check dynamically would work better. So in this installaition of &#8220;Project Of The Day&#8221;, I went ahead and implemented it. The result is Groovy sandbox. My main idea is to confine [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton129" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F29%2Fpotd-groovy-sandbox%2F&amp;text=POTD%3A%20Groovy%20Sandbox&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F29%2Fpotd-groovy-sandbox%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I posted the other day <a href="http://kohsuke.org/2012/04/27/groovy-secureastcustomizer-is-harmful/">about Groovy&#8217;s SecureASTCustomizer</a> and how it is harmful. In the end of that post, I suggested that doing the check dynamically would work better.</p>
<p>
So in this installaition of <a href="http://kohsuke.org/category/potd/">&#8220;Project Of The Day&#8221;</a>, I went ahead and implemented it. The result is <a href="http://groovy-sandbox.kohsuke.org/">Groovy sandbox</a>. </p>
<div align=center>
  <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Sandbox_with_toys.JPG/320px-Sandbox_with_toys.JPG" style="margin:1em">
</div>
<p>
My main idea is to confine the sandboxed script into its local object graph. The script should be allowed to mutate this graph all it wants, but it&#8217;ll be only allowed to include objects of known whitelisted &#8220;safe&#8221; types (such as <tt>String</tt>, <tt>List</tt>, <tt>Date</tt> etc.), and a few known safe instances, which acts as a bridge between the sandbox and the rest of the world. These bridge objects would have to be written carefully.</p>
<p>
To use this, you have to add <tt>SandboxTransformer</tt> to your <tt>CompilerConfiguration</tt> first:</p>
<pre>
def cc = new CompilerConfiguration()
cc.addCompilationCustomizers(new SecureTransformer())
def binding = new Binding();
binding.robot = robot = new Robot();
def sh = new GroovyShell(binding,cc)
</pre>
<p>
And now any script compiled via the resulting shell object will be sandboxed.</p>
<p>
When a sandboxed script executes, all of the following operations are intercepted. </p>
<ul>
<li>static/instance method invocation <tt>foo.bar(....)</tt>
<li>object allocation <tt>new Foo(...)</tt>
<li>property access and assignment <tt>zot=foo.bar / foo.bar=zot</tt>
<li>attributes access and assignment <tt>zot=foo.@bar / foo.@bar=zot</tt>
<li>array access and assignment <tt>zot=foo[bar] / foo[bar]=zot</tt>
</ul>
<p>
To examine those calls and reject some of them, create your own implementation of <tt>GroovyInterceptor</tt> and registers it to the thread before you start executing the script:</p>
<pre>
def sandbox = new RobotSandbox()
sandbox.register()
try {
    sh.evaluate("robot.leftArm.move()")  // this is allowed to complete
    sh.evaluate("robot.selfDestruct()")  // no!
} finally {
    sandbox.unregister()
}
</pre>
<p>
See <a href="https://github.com/kohsuke/groovy-sandbox/tree/master/src/test/groovy/org/kohsuke/groovy/sandbox/robot">the robot example</a> for a complete example.</p>
<p>
Now let&#8217;s see if I can get some feedback from real Groovy experts, and see if they&#8217;d be willing to take this into Groovy itself&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/04/29/potd-groovy-sandbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Groovy SecureASTCustomizer is harmful</title>
		<link>http://kohsuke.org/2012/04/27/groovy-secureastcustomizer-is-harmful/</link>
		<comments>http://kohsuke.org/2012/04/27/groovy-secureastcustomizer-is-harmful/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 03:43:44 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=128</guid>
		<description><![CDATA[Tweet I was looking at Groovy DSL slides from Guillaume Laforge when I noticed about SecureASTCustomizer, which led me to what appers to be the original introduction post from Cedric. Being able to lock Groovy execution down would enable me to use Groovy in more places, so I did a bit of experiment. But I [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton128" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F27%2Fgroovy-secureastcustomizer-is-harmful%2F&amp;text=Groovy%20SecureASTCustomizer%20is%20harmful&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F27%2Fgroovy-secureastcustomizer-is-harmful%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p><img src="http://groovy.codehaus.org/images/groovy-logo-medium.png" style="float:left; margin:1em; width:200px"></p>
<p>
I was looking at <a href="http://www.slideshare.net/glaforge/going-to-mars-with-groovy-domainspecific-languages">Groovy DSL slides from Guillaume Laforge</a> when I noticed about <tt>SecureASTCustomizer</tt>, which led me to what appers to be <a href="http://www.jroller.com/melix/entry/customizing_groovy_compilation_process">the original introduction post from Cedric</a>.</p>
<p>
Being able to lock Groovy execution down would enable me to use Groovy in more places, so I did a bit of experiment. But I regrettably have to conclude that this feature is practically unusable. In fact I&#8217;d argue that it is actively harmful, as it gives a programmer a false comfort.</p>
<p>
The fundamental problem is that Groovy is a dynamic language, yet <tt>SecureASTCustomizer</tt> works by looking at Groovy AST <b>statically</b>. So it&#8217;s very easy for Maloney, a malicious attacker, to bypass many of the checks. For example, Cedric&#8217;s post talks about how it can let you blacklist/whitelist classes that can be imported. Well, the actual goal of the programmer is to prevent the class from getting used, and not to get them imported. And sure enough, even if I white list the importable classes to <tt>java.lang.Math</tt>, Maloney can still do <tt>Math.class.forName('some.secret.class')</tt> to get a reference to a <tt>Class</tt>, and therefore render the import restrictions pointless.</p>
<p>
Then I thought about disabling access to the <tt>getClass()</tt> method. But this doesn&#8217;t work well either because Groovy allows <tt>5."class"</tt> and <tt>5["class"]</tt> to access properties. To statically prevent this, you&#8217;d have to prohibit the array access and a string literal, but that doesn&#8217;t leave much of a language!</p>
<p>
Many other checks offered by <tt>SecureASTCustomizer</tt> are equally useless. For example, there&#8217;s <tt>receiversClassesWhiteList</tt> that&#8217;s supposed to let you restrict the methods the script can invoke by whitelisting the declaring class of the method.  But once again, this is a static check! Groovy compiler doesn&#8217;t work very hard to infer types, so much so that it can&#8217;t even guess that <tt>x=="foo"</tt> is a boolean type. Therefore, if you actually try using receiver whitelisting, pretty quickly you&#8217;ll discover that you either have to allow <tt>Object</tt> as a receiver (because Groovy assigns this to every expression when it couldn&#8217;t infer the type), which will basically renders the point of whitelisting moot as you can now invoke any method by simply casting the expression to <tt>Object</tt>.</p>
<p>
If you go the other route and disallow <tt>Object</tt> as a receiver. That will reject almost all non-trivial scripts. Or I suppose you can prohibit a method call, but that doesn&#8217;t leave much of a language, does it.</p>
<p>
Like I said, I think this is fundamentally a futile approach. You just can&#8217;t perform any meaningful static sandboxing on a dynamic language. </p>
<p>
Instead, what I think is more fruitful is a dynamic checking. For example, what if the compile-time AST transformation intercepts every  method call and property access? That is, transform <tt>z=x.y</tt> as <tt>z=checkedGet(x,"y")</tt>, transform <tt>x.y=5</tt> into <tt>checkedSet(x,"y",5)</tt>, and finally transform <tt>o.foo(a,b,c)</tt> into <tt>checkedCall(o,"foo",[a,b,c])</tt>. This does make execution a whole lot slower, but I can now perform meaningful checks. And unlike Java SecurityManager, this is a lot more friendly to libraries and web applications, who cannot take over the entire JVM.</p>
<p>
I haven&#8217;t actually put together such an AST transformer, but this doesn&#8217;t look too hard.</p>
<p>
What do people think?</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/04/27/groovy-secureastcustomizer-is-harmful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>COM4J updates</title>
		<link>http://kohsuke.org/2012/04/27/com4j-updates/</link>
		<comments>http://kohsuke.org/2012/04/27/com4j-updates/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 20:13:53 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[com4j]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=127</guid>
		<description><![CDATA[TweetIt&#8217;s been a while, but I&#8217;ve posted a new version of COM4J. COM4J is a library that lets you talk to Windows COM components. Unlike similar libraries lika jacob, which makes you feel like you are working with reflection, COM4J is designed to work with type-safe annotated interfaces, which makes you feel like you are [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton127" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F27%2Fcom4j-updates%2F&amp;text=COM4J%20updates&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F27%2Fcom4j-updates%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>It&#8217;s been a while, but I&#8217;ve posted <a href="https://github.com/kohsuke/com4j/downloads">a new version</a> of <a href="http://com4j.kohsuke.org/">COM4J</a>. COM4J is a library that lets you talk to Windows COM components. Unlike similar libraries lika jacob, which makes you feel like you are working with reflection, COM4J is designed to work with type-safe annotated interfaces, which makes you feel like you are working with Java libraries. COM4J is also built on top of vtable invocation, not on <tt>IDispatch</tt>, so it can work with components without the dual interface support (boy those words bring back memories!)</p>
<p>I use this library in <a href="http://jenkins-ci.org/">Jenkins</a>, among other places, to provide a better native integration.</p>
<p>The major change in this version is that it finally has 64bit Java support. The original work was contributed in 2011, but I&#8217;ve never cut a release out of it officially. It contains a number of bug fixes, additional conversions support. The code is now on <a href="https://github.com/kohsuke/com4j">GitHub</a>, and the website is moved to <a href="http://com4j.kohsuke.org/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/04/27/com4j-updates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Butler’s Service: Promotion for Jenkins User Conference in Paris</title>
		<link>http://kohsuke.org/2012/04/04/the-butlers-service-promotion-for-jenkins-user-conference-in-paris/</link>
		<comments>http://kohsuke.org/2012/04/04/the-butlers-service-promotion-for-jenkins-user-conference-in-paris/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 06:59:45 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[juc]]></category>
		<category><![CDATA[paris]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=125</guid>
		<description><![CDATA[TweetWe have just increased our enrollment capacity for the Jenkins User Conference (JUC) Paris, to be held on April 17th. The enthusiastic response to our first-ever Paris JUC has been terrific – and we want to get everyone there! The learning, networking and connecting that occurs within the Jenkins community at JUC is great to [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton125" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F04%2Fthe-butlers-service-promotion-for-jenkins-user-conference-in-paris%2F&amp;text=The%20Butler%26%238217%3Bs%20Service%3A%20Promotion%20for%20Jenkins%20User%20Conference%20in%20Paris&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F04%2F04%2Fthe-butlers-service-promotion-for-jenkins-user-conference-in-paris%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p><a href="http://4.bp.blogspot.com/-81B5lYN8Nvk/T3yBIbZi-uI/AAAAAAAAAKQ/pTlgVPwCJgo/s1600/Jenkins_Butler.png"><img class="alignleft" src="http://4.bp.blogspot.com/-81B5lYN8Nvk/T3yBIbZi-uI/AAAAAAAAAKQ/pTlgVPwCJgo/s1600/Jenkins_Butler.png" alt="" width="114" height="128" /></a>We have just increased our enrollment capacity for the <a href="http://www.cloudbees.com/jenkins-user-conference-2012-paris.cb">Jenkins User Conference (JUC) Paris</a>, to be held on April 17th. The enthusiastic response to our first-ever Paris JUC has been terrific – and we want to get everyone there! The learning, networking and connecting that occurs within the Jenkins community at JUC is great to see. I saw it in spades last fall in San Francisco and it was terrific. I want every Jenkins user who is able to experience JUC to do so.</p>
<p>Since Mr. Jenkins, our iconic butler, and I are traveling to every JUC conference this year – all six of them – we have worked up a little scheme, with the folks from our sponsor CloudBees, to get YOU there, too.</p>
<p>Here is the deal. Jenkins and I are offering a special <strong>Butler’s Service promotion for JUC Paris</strong>. Ticket prices recently increased to the full conference price of €206, from a previously discounted rate of €104. The registration fee is needed to cover the cost of the conference, but we realize this can get in the way of people trying to attend. As a compromise, on this Thursday and Friday, 5-6 April, we will reduce the ticket price to the lower advance registration special pricing that was in effect. So on Thursday and Friday, you can still <a href="http://www.cloudbees.com/jenkins-user-conference-2012-paris.cb">register for JUC Paris</a> at the lower €104 price. (For anyone who paid the full conference price, we will refund the difference.)</p>
<p>Let Your Friends and Colleagues Know About This Special Offer!</p>
<p>To experience what JUC is like, watch <a href="http://www.cloudbees.com/juc2012.cb#Highlights">the highlights video</a> from our San Francisco conference. It will give you a feel for the quality of our speakers, the learning – and, yes, the fun that went on!</p>
<p>We have a lot to share with you on April 17. In addition to all of <a href="http://www.cloudbees.com/jenkins-user-conference-2012-paris.cb">the great sessions we are offering</a>, you&#8217;ll get to see many developers of the plugins you&#8217;ve been using (some of whom even I haven&#8217;t met before in person!), and there will be some exciting updates and other news to share about our favorite continuous integration platform. You will want to be there to hear and see it all, first hand.</p>
<p>I hope to see you on April 17 in Paris &#8211; be sure to <a href="http://www.cloudbees.com/jenkins-user-conference-2012-paris.cb">sign up by end-of-day, Friday</a>, and take advantage of this great deal served up by the Butler!</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/04/04/the-butlers-service-promotion-for-jenkins-user-conference-in-paris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian and Maven, a crash of culture</title>
		<link>http://kohsuke.org/2012/03/16/debian-and-maven-a-crash-of-culture/</link>
		<comments>http://kohsuke.org/2012/03/16/debian-and-maven-a-crash-of-culture/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 17:50:26 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[package]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=119</guid>
		<description><![CDATA[Tweet Tim O&#8217;Brien posted his frustration about the state of Java packaging in Debian. While I&#8217;m not affiliated with Debian nor Ubuntu, I wanted to post something in defense. I completely understand where Tim is coming from. To the eyes of Java developers, the Java packaging in Debian looks completely Sisyphean. We got all the [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton119" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F16%2Fdebian-and-maven-a-crash-of-culture%2F&amp;text=Debian%20and%20Maven%2C%20a%20crash%20of%20culture&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F16%2Fdebian-and-maven-a-crash-of-culture%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>
Tim O&#8217;Brien <a href="http://discursive.com/2012/03/15/the-debian-java-package-team-futility-defined/">posted his frustration about the state of Java packaging in Debian</a>. While I&#8217;m not affiliated with Debian nor Ubuntu, I wanted to post something in defense.</p>
<p>
I completely understand where Tim is coming from. To the eyes of Java developers, the Java packaging in Debian looks completely Sisyphean. We got all the binaries and their dependencies captured in a machine readable form (aka POM). Can&#8217;t we just take them as-is, do a bit of metadata conversion, and make all those artifacts available to the Debian world so that we can just have a single package manager on Debian? If that&#8217;s your line of reasoning, you are in for a surprise, because Debian wouldn&#8217;t like that.</p>
<p>
The reason they don&#8217;t do it is well summarized in <a href="http://www.debian.org/social_contract">the Debian Social Contract</a>. It&#8217;s the equivalent of the U.S. Constitution for the Debian project &mdash; everything they do derive from this. Binary jars are bad for Debian because they don&#8217;t give the users the freedom to modify them and create derivative works. Debian is not just a means to let you conveniently install all the programs you need. It&#8217;s a pursuit of certain kinds of freedom.</p>
<p>
In that sense, it&#8217;s somewhat like the &#8220;Free Software&#8221; movement. They both have some pretty strong guiding principles, and at times, for outsiders they look like they are &#8220;wasting&#8221; their efforts or being impractical. But the thing is, it&#8217;s those guiding principles that attract so many people to the effort, and that&#8217;s what keeps the project going and produce all the incredible good stuff that we use everyday. Criticizing them for their principles while you enjoy the benefits of the very same principles feel bit single-handed to me.</p>
<p>
I think a better way forward is to write a little program that takes the source jar (which most jars in the Maven central should already have) and the POM, then generate a build script that simply compiles the source jar into the binary jar. The said program should also inspect the jar file to figure out any resource files, and treat them as source files. That way, we can machine-generate Debian source packages. Granted, not all source packages produced that way would pass the requirements of the Debian Freesoftware Guideline, but I bet substantial number of Maven artifacts are simple enough that this will be actually completely satisfactory. And then humans can concentrate on harder ones.</p>
<p>
Anyone interested in giving that a shot?</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/03/16/debian-and-maven-a-crash-of-culture/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Come join us on “Selenium, Jenkins, Robots, Oh My!” tomorrow</title>
		<link>http://kohsuke.org/2012/03/13/come-join-us-on-selenium-jenkins-robots-oh-my-tomorrow/</link>
		<comments>http://kohsuke.org/2012/03/13/come-join-us-on-selenium-jenkins-robots-oh-my-tomorrow/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 21:49:30 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[meetup]]></category>
		<category><![CDATA[san francisco]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=118</guid>
		<description><![CDATA[Tweet I&#8217;ll be speaking tomorrow at San Francisco Selenium Meetup about Jenkins &#38; Selenium &#8212; mainly recent improvements in the Selenium plugin, as well as several other new plugins relevant in the combination of Jenkins and Selenium, complete with a demo. I&#8217;ve got a couple of pet-peeves against the Selenium project, so I&#8217;m going to [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton118" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F13%2Fcome-join-us-on-selenium-jenkins-robots-oh-my-tomorrow%2F&amp;text=Come%20join%20us%20on%20%26%238220%3BSelenium%2C%20Jenkins%2C%20Robots%2C%20Oh%20My%21%26%238221%3B%20tomorrow&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F13%2Fcome-join-us-on-selenium-jenkins-robots-oh-my-tomorrow%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>
I&#8217;ll be speaking tomorrow at San Francisco Selenium Meetup about Jenkins &amp; Selenium &mdash; mainly recent improvements in <a href="https://wiki.jenkins-ci.org/display/JENKINS/Selenium+Plugin">the Selenium plugin</a>, as well as several other new plugins relevant in the combination of Jenkins and Selenium, complete with a demo. I&#8217;ve got a couple of pet-peeves against the Selenium project, so I&#8217;m going to pitch them there to see the reaction, too.</p>
<p>
I&#8217;ve told that Jason Huggins from Sauce Lab is going to pick up <a href="http://www.youtube.com/watch?v=eg6oLVG1rn0&#038;feature=youtu.be">where he left off in the last Jenkins User Conference</a> to talk about his robot, and Theo Cincotta from Eventbrite will give the case study of how Eventbrite uses Jenkins &amp; Selenium together internally, so the whole thing should be a great mix of fun &amp; useful topics, all packed in a Wednesday night from 6:30pm to 8:00pm, with beer and food.</p>
<p>
The event is free, but <a href="http://seleniumjenkinsrobots.eventbrite.com/">you do need to RSVP</a>, instead of the usual RSVP in the SF Selenium meetup group page at meetup.com (which currently says 209 people coming, when the EventBrite RSVP page says the capacity is 100 people &mdash; so I need to check with the organizers to make sure they know what they are expecting&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/03/13/come-join-us-on-selenium-jenkins-robots-oh-my-tomorrow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Attaching files to JUnit tests</title>
		<link>http://kohsuke.org/2012/03/13/attaching-files-to-junit-tests/</link>
		<comments>http://kohsuke.org/2012/03/13/attaching-files-to-junit-tests/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 17:20:53 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=103</guid>
		<description><![CDATA[TweetDespite the fact that it is the de-facto standard of test reports in any programming languages (perhaps except .NET), JUnit test report format has a number of problems. One is that the format isn&#8217;t explicitly defined (and I&#8217;ll discuss this in a separate post), but another problem, which I&#8217;m going to dedicate this post for, [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton103" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F13%2Fattaching-files-to-junit-tests%2F&amp;text=Attaching%20files%20to%20JUnit%20tests&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F13%2Fattaching-files-to-junit-tests%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Despite the fact that it is the de-facto standard of test reports in any programming languages (perhaps except .NET), <a href="http://ant.apache.org/manual/Tasks/junitreport.html">JUnit test report format</a> has a number of problems. One is that the format isn&#8217;t explicitly defined (and I&#8217;ll discuss this in a separate post), but another problem, which I&#8217;m going to dedicate this post for, is the lack of attachment support.</p>
<p>
It is often <i>very</i> conveniet to be able to attach arbitrary files to a test report. Imagine Selenium tests capturing screenshots. Or JavaEE tests that deploy webapps, then you want to capture server log files. Or if you are doing UI automation testing, how about a video recording that your screen automation framework has produced?</p>
<p>
Today, doing this mostly requires that you (as a test author) write some files somewhere, then print out that file name to stdout/stderr. This works for humans who are looking at the output, but not for CI servers like <a href="http://jenkins-ci.org/">Jenkins</a>. So I hereby propose a bit of convention to decorate this current practice, to make those files discoverable by Jenkins.</p>
<p>
For this, I&#8217;ve improved <a href="https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Attachments+Plugin">the JUnit attachments plugin</a> to recognize the following format. It has to occupy a whole line.</p>
<pre>
[[ATTACHMENT|<i>&lt;absolute file name&gt;</i>]]
[[ATTACHMENT|<i>&lt;absolute file name&gt;</i>|{ ... <i>additional metadata in JSON</i> ... }]]
</pre>
<p>
The additional metadata isn&#8217;t currently used, but I intended it to describe what the attached file means. For example, if your test always attach a couple of log files, it&#8217;d be useful to describe which file is which, so that CI servers or test report tools can display them as such. Or metadata for human readable display name would be useful, as these attachment file names are often cryptic just to make them unique.</p>
<p>
When you run these tests from within Jenkins, these files are then picked up and stored by Jenkins, and the test report page will include them as links.</p>
<div align=center>
<img height=194 width=400 src=https://wiki.jenkins-ci.org/download/attachments/42467572/junit-attachments.png?version=1&#038;modificationDate=1259329086000>
</div>
<p>
Ideally, the test report format should be expanded to cover things like this, but unfortunately I think that&#8217;d require too much collaboration between too many people to the point that it&#8217;s unrealistic &mdash; if we are to do that, test frameworks like JUnit first needs to offer this as API methods for listeners, then the test drivers like Ant/Maven needs to be expanded to honor those when they produce test reports. Then finally we can improve the CI servers.</p>
<p>
I&#8217;ve been patiently waiting for that to happen for long time, but it&#8217;s just not happening. So instead, I&#8217;m taking the matter into my own hands, and came up with this convention.</p>
<p>
Convention like this is useful only if enough people uses it. So I hope you&#8217;ll like this. If you think this convention can be improved, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/03/13/attaching-files-to-junit-tests/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>POTD: Package renamed ASM</title>
		<link>http://kohsuke.org/2012/03/03/potd-package-renamed-asm/</link>
		<comments>http://kohsuke.org/2012/03/03/potd-package-renamed-asm/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 17:13:03 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[potd]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asm]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=116</guid>
		<description><![CDATA[TweetToday&#8217;s project of the day is a package renamed ASM library. I previously wrote about a problem in otherwise quite useful ObjectWeb ASM library. Namely, it breaks backward compatibility in such a way that badly breaks apps/libraries that use them. In that post, I wrote about two proposals to fix the pain point. One is [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton116" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F03%2Fpotd-package-renamed-asm%2F&amp;text=POTD%3A%20Package%20renamed%20ASM&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F03%2Fpotd-package-renamed-asm%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Today&#8217;s project of the day is a package renamed ASM library.</p>
<p>I previously <a href="http://weblogs.java.net/blog/kohsuke/archive/2010/02/12/asm-incompatible-changes">wrote about a problem</a> in otherwise quite useful ObjectWeb ASM library. Namely, it breaks backward compatibility in such a way that badly breaks apps/libraries that use them. In that post, I wrote about two proposals to fix the pain point. One is to include debug information, which has been fixed starting 3.x. But the other package renaming hasn&#8217;t been addressed in the last 2 years.</p>
<p>This has been in the back of my head, but it never came high enough until recently I had another <tt>NoSuchMethodError</tt> caused by ASM3. One of the servlet containers shipped ASM3 and it broke Jenkins that bundles ASM2. Between this and ASM4 release for JavaSE 7, which will likely gain popularity over time, I finally decided to fix this problem once and for all, in a way that everyone else can reuse.</p>
<p>The solution, as explained in the original post, is to put each major ASM version in its unique package name. I pakage-renamed ASM2 in <tt>org.kohsuke.asm2</tt>, ASM3 in <tt>org.kohsuke.asm3</tt>, and ASM4 in <tt>org.kohsuke.asm4</tt>. The package name only contains the major version because I trust the ASM developers to maintain compatibility between minor releases (and I believe they&#8217;ve maintained this thus far.)</p>
<p>These artifacts are available in <a href="http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.kohsuke%20a%3Aasm2"><tt>org.kohsuke:asm2:2.2.3</tt></a>, <a href="http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.kohsuke%20a%3Aasm3"><tt>org.kohsuke:asm3:3.3.0</tt></a>, and <a href="http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.kohsuke%20a%3Aasm4"><tt>org.kohsuke:asm4:4.0</tt></a> &mdash; these are packaged renamed by jarjar and I tested them somewhat to make sure it&#8217;s not downright broken.</p>
<p>If library A depends on asm2 and library B depends on asm3, and someone else uses both A and B, everything will work fine because asm2 and asm3 are in the different pcakages. If A depends on one version of asm3 and B depends on another version of asm3, then the transitive dependency resolution will pick up the newer version and both will work (or you end up implicitly picking up one version over another, and you don&#8217;t enjoy the latest bug fixes, but at least it won&#8217;t die with <tt>LinkageError</tt>.)</p>
<p>When you <a href="http://search.maven.org/#search%7Cga%7C2%7Casm3">search &#8220;asm3&#8243; in Maven central</a>, you see a large number of renamed ASM3 in various projects. Hopefully that madness will stop now!</p>
<p>The other interesting thing about this effort is that I&#8217;ve <a href="https://github.com/kohsuke/package-renamed-asm">used Gradle</a> to package rename them. Lately I&#8217;ve been using Gradle for publishing transformed artifacts like these to a Maven repository, and I like it a lot. But more about that in another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/03/03/potd-package-renamed-asm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>POTD: checking package name for Windows reserved words</title>
		<link>http://kohsuke.org/2012/03/01/potd-checking-package-name-for-windows-reserved-words/</link>
		<comments>http://kohsuke.org/2012/03/01/potd-checking-package-name-for-windows-reserved-words/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 06:51:10 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[potd]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[javac]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=115</guid>
		<description><![CDATA[TweetToday&#8217;s project of the day is a little tool that checks problems in your package names that can bite you on Windows. For backward compatibility with MS-DOS (which had ended its life more than 15 years ago!), Windows doesn&#8217;t allow you to create files/directories of certain names, such as &#8220;AUX&#8221; or &#8220;PRN&#8221; (see Microsoft Knowledge [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton115" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F01%2Fpotd-checking-package-name-for-windows-reserved-words%2F&amp;text=POTD%3A%20checking%20package%20name%20for%20Windows%20reserved%20words&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F03%2F01%2Fpotd-checking-package-name-for-windows-reserved-words%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Today&#8217;s project of the day is a little tool that checks problems in your package names that can bite you on Windows.</p>
<p>For backward compatibility with MS-DOS (which had ended its life more than 15 years ago!), Windows doesn&#8217;t allow you to create files/directories of certain names, such as &#8220;AUX&#8221; or &#8220;PRN&#8221; (see <a href="http://support.microsoft.com/kb/74496/en-us">Microsoft Knowledge Base</a>.)</p>
<p>This can bite those of us who develop on Unix &mdash; when you accidentally create a file or a directory of this name (say in the package name), it&#8217;ll be all right for you, but your colleagues who use Windows will not be able to build them. Worse yet, if none of your colleagues use Windows either, this problem can get unnoticed until you ship/test the code.</p>
<p>So I wrote <a href="http://windows-package-checker.kohsuke.org/">a little tool</a> that proactively checks for this problem. It&#8217;s an annotation processor that kicks in automatically, so you just need to add it in your classpath when you compile your source files. If you use a build system that can handle transitive dependencies (such as Gradle or Maven), you just need to use it in one of your libraries, and all the code that uses your library also benefits from this check.</p>
<p>My hats off to Microsoft for their rigorous commitment to the backward compatibility, and just one more reason why you should be <i>always</t> testing your Java program on multiple platforms&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/03/01/potd-checking-package-name-for-windows-reserved-words/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Jenkins User Conferences 2012</title>
		<link>http://kohsuke.org/2012/02/28/jenkins-user-conferences-2012/</link>
		<comments>http://kohsuke.org/2012/02/28/jenkins-user-conferences-2012/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 18:31:25 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[juc]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=113</guid>
		<description><![CDATA[Tweet As a result of the success of the Jenkins User Conference last year in San Francisco, this year CloudBees and other sponsors are planning 4 Jenkins User Conferences around the world. Yup, that&#8217;s right &#8212; four! Making events like these successful would be a win for everyone, so I&#8217;d like to encourage you to [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton113" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F02%2F28%2Fjenkins-user-conferences-2012%2F&amp;text=Jenkins%20User%20Conferences%202012&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F02%2F28%2Fjenkins-user-conferences-2012%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>
As a result of the success of <a href="http://www.cloudbees.com/jenkins-user-conference-2011.cb">the Jenkins User Conference last year in San Francisco</a>, this year CloudBees and other sponsors are planning 4 Jenkins User Conferences around the world. Yup, that&#8217;s right &mdash; four!</p>
<p>
Making events like these successful would be a win for everyone, so I&#8217;d like to encourage you to &#8230;:</p>
<h5>Register to attend</h5>
<p>
If you are in the greater Paris or NY City metro areas, <a href="http://www.cloudbees.com/juc2012.cb">sign up now</a>!  You will experience lots of great learning opportunities and further your Jenkins knowledge. And perhaps more importantly, you&#8217;ll get the chance to connect with other Jenkins users and learn about the latest developments in the Jenkins project. I always love watching the community interact – we all learn from each other and on so many occasions, I have seen a Jenkins user have an &#8220;Aha!&#8221; moment in conversation with another Jenkins user. There&#8217;s something magical about meeting face-to-facet that you just can&#8217;t replace any other way.</p>
<p>
Dates for the JUC conferences in the first half of 2012 are:</p>
<ul>
<li>
Paris &mdash; April 17: Early Bird discounted registration (€50) ends 18 February</p>
<li>
New York City &mdash; May 17: Early Bird discounted registration ($54) ends 25 February</p>
<li>
Registration includes all sessions, lunch, a social/networking hour at the end of the day and a FREE Jenkins t-shirt (a hot commodity at the JUC last October)</p>
<li>
Two more conferences will be scheduled later in the year in San Francisco(Sept) and Antwerp (Nov), and there&#8217;s a planning going on for one in Tokyo &mdash; stay tuned for dates.
</ul>
<h5>Apply to speak</h5>
<p>
<a href="https://www.cloudbees.com/forms/jenkins-user-conference-call-papers.cb">Share your Jenkins knowledge with the community</a>. The quality of the speakers was the most highly praised aspect of JUC 2011. If you&#8217;ve been writing plugins, tell the community what those are and meet people who use your plugins, which is quite a rewarding experience. If you&#8217;ve been using Jenkins in interesting ways, tell the community about it, and through the feedback you&#8217;ll learn just as much as they would. Do it fast though &mdash; the deadline for Paris is February 24th and for New York is March 16th.</p>
<h5>Sign up to sponsor</h5>
<p>
If you can, <a href="http://www.cloudbees.com/jenkins-user-conference-2012-sponsorship.cb">consider sponsoring the events</a>. If you feel your organization has benefitted from Jenkins, now’s your chance to give back to the community&#8230; and at the same time get some great visibility for your company.</p>
<p>
&nbsp;</p>
<p>
If you still need more convincing about JUC, <a href="http://www.cloudbees.com/juc2012.cb">watch the highlights video</a> from last year&#8217;s conference. Looking forward to seeing you!</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/02/28/jenkins-user-conferences-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 1.020 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-09 23:41:32 -->

