<?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:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7941992856438598472</atom:id><lastBuildDate>Mon, 21 May 2012 06:15:07 +0000</lastBuildDate><category>maven</category><category>assembly</category><category>binary</category><title>Technically Yours</title><description /><link>http://tech.abhishekontheweb.com/</link><managingEditor>noreply@blogger.com (Abhishek Bhattacherjee)</managingEditor><generator>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TechnicallyYours" /><feedburner:info uri="technicallyyours" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>TechnicallyYours</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7941992856438598472.post-7867832784461992728</guid><pubDate>Thu, 11 Mar 2010 01:39:00 +0000</pubDate><atom:updated>2010-03-13T00:42:31.374-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">binary</category><category domain="http://www.blogger.com/atom/ns#">maven</category><category domain="http://www.blogger.com/atom/ns#">assembly</category><title>Binary files and Maven</title><description>&lt;div style="text-align: justify;"&gt;Recently, I was frustrated while trying to package a Java keystore file from my Maven project to a project archive (tar or zip) using assembly.xml. Somehow, when I used the command:&lt;/div&gt;&lt;blockquote&gt;keytool -keystore cacerts -list&lt;/blockquote&gt;&lt;div style="text-align: justify;"&gt;on the certificate keystore inside the tar/zip archive, it would just say that the keystore is invalid. After some search, I found that there is a little setting in the pom.xml which instructs maven not to do any filtering tasks on the files you specify when you execute a maven command.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Lets talk a bit about maven resources filtering. &lt;a href="http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html"&gt;Maven resources documentation&lt;/a&gt; has a very good explanation of this feature.&amp;nbsp; Basically, when you use filtering=true inside your resources tag, the output file in the target folder will contain dynamic values of fields (if it had any). Like, for example:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;a href="http://3.bp.blogspot.com/_EVs9NRbOu5Y/S5hIiwWNoTI/AAAAAAAAH0U/R4ZpFTih6oY/s1600-h/Screen+shot+2010-03-10+at+7.33.32+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="92" src="http://3.bp.blogspot.com/_EVs9NRbOu5Y/S5hIiwWNoTI/AAAAAAAAH0U/R4ZpFTih6oY/s320/Screen+shot+2010-03-10+at+7.33.32+PM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Suppose, src/main/resources has a Hello.txt, whose contents are Hello ${name}&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;If filtering is true, ${name} is going to be replaces with the actual value of the property "name" in the pom.xml, when the file is copied to target folder.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Now, even though this filtering is useful, sometimes, we don't want maven to apply this feature on all files in the directory - for example certificate key stores, which are inherently binary in nature. So how do you tackle this? Simple, just use something like this:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;a href="http://2.bp.blogspot.com/_EVs9NRbOu5Y/S5hH5tTF0cI/AAAAAAAAH0E/ci3xKQd8qQ4/s1600-h/Screen+shot+2010-03-10+at+7.30.36+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="292" src="http://2.bp.blogspot.com/_EVs9NRbOu5Y/S5hH5tTF0cI/AAAAAAAAH0E/ci3xKQd8qQ4/s320/Screen+shot+2010-03-10+at+7.30.36+PM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Here, I am manually excluding files on which I don't want to apply filters.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Also, in the assembly.xml, I would like to keep line endings, as they might also corrupt these files.&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;a href="http://2.bp.blogspot.com/_EVs9NRbOu5Y/S5hILbBWePI/AAAAAAAAH0M/j_2oORZxIjk/s1600-h/Screen+shot+2010-03-10+at+7.32.04+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_EVs9NRbOu5Y/S5hILbBWePI/AAAAAAAAH0M/j_2oORZxIjk/s320/Screen+shot+2010-03-10+at+7.32.04+PM.png" width="305" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;These simple steps will enable you to package any binary content files using Maven.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941992856438598472-7867832784461992728?l=tech.abhishekontheweb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TechnicallyYours/~4/FvdpHfcIqtQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/TechnicallyYours/~3/FvdpHfcIqtQ/binary-files-and-maven.html</link><author>noreply@blogger.com (Abhishek Bhattacherjee)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_EVs9NRbOu5Y/S5hIiwWNoTI/AAAAAAAAH0U/R4ZpFTih6oY/s72-c/Screen+shot+2010-03-10+at+7.33.32+PM.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://tech.abhishekontheweb.com/2010/03/binary-files-and-maven.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7941992856438598472.post-1665132366544530306</guid><pubDate>Sat, 27 Feb 2010 16:43:00 +0000</pubDate><atom:updated>2010-02-27T11:12:53.930-06:00</atom:updated><title>So Why This Blog?</title><description>&lt;div style="text-align: justify;"&gt;I have been toying over the idea of creating a separate blog for my technical wanderings for some time now. Earlier, I had posted some technical posts on my main blog - &lt;a href="http://www.abhishekontheweb.com/"&gt;www.abhishekontheweb.com&lt;/a&gt;, but, now, those seem out of place in a blog, which deals with more general stuff, like events, photography, articles (and whatever random thought comes in my mind). As, in the last few years, I have been working on various technologies, especially Java based, I thought of writing about some of the technical ideas that I have been influenced by, technical issues I have been intrigued by, and the upcoming technologies that I am working on. And what better place than to have a new blog just for that. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I would like to put in as much details as possible in my post, else this blog would defeat its purpose.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941992856438598472-1665132366544530306?l=tech.abhishekontheweb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TechnicallyYours/~4/hRLjFC14D28" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/TechnicallyYours/~3/hRLjFC14D28/welcome.html</link><author>noreply@blogger.com (Abhishek Bhattacherjee)</author><thr:total>5</thr:total><feedburner:origLink>http://tech.abhishekontheweb.com/2010/02/welcome.html</feedburner:origLink></item></channel></rss>

