<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Drop By!</title>
	<atom:link href="http://www.rekk.de/bloggy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rekk.de/bloggy</link>
	<description>Dropping Brain Crumbs ...</description>
	<lastBuildDate>Wed, 09 Jun 2010 16:59:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Toggle Line and Word Wrapping in Thunderbird</title>
		<link>http://www.rekk.de/bloggy/2010/toggle-line-and-word-wrapping-in-thunderbird/</link>
		<comments>http://www.rekk.de/bloggy/2010/toggle-line-and-word-wrapping-in-thunderbird/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 16:57:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=160</guid>
		<description><![CDATA[You want thunderbird to keep your preformatted text in emails? Here is a plugin for this: https://addons.mozilla.org/en-US/thunderbird/addon/2351
&#8230; for instance to send a configuration file to majordomo list manager.
]]></description>
			<content:encoded><![CDATA[<p>You want thunderbird to keep your preformatted text in emails? Here is a plugin for this: <a href="https://addons.mozilla.org/en-US/thunderbird/addon/2351">https://addons.mozilla.org/en-US/thunderbird/addon/2351</a></p>
<p>&#8230; for instance to send a configuration file to majordomo list manager.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2010/toggle-line-and-word-wrapping-in-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LDAP Query to Find Groups for a Member</title>
		<link>http://www.rekk.de/bloggy/2009/ldap-query-to-find-groups-for-a-member/</link>
		<comments>http://www.rekk.de/bloggy/2009/ldap-query-to-find-groups-for-a-member/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 13:16:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=158</guid>
		<description><![CDATA[Situation: You have a lot of groups as groupOfNames in you ldap directory. How to find all such groups a known member belongs to?
The goupOfNames object might look similiar to this:
dn: cn=TestGroup, o=TestOne, dc=rekk, dc=de
objectClass: dcObject
objectClass: groupOfNames
cn: cn=TestGroup
dc: dc=TestGroup
description: Some test group
member: uid=00001
member: uid=00011
member: uid=schwarz,dc=Test DC,dc=rekk,dc=de
The query would be for uid=schwarz:
(member=uid=schwarz,dc=Test DC,dc=rekk,dc=de)
or more specific:
(&#38;(objectclass=groupofnames)(member=uid=schwarz,dc=Test DC,dc=rekk,dc=de)
Also [...]]]></description>
			<content:encoded><![CDATA[<p>Situation: You have a lot of groups as groupOfNames in you ldap directory. How to find all such groups a known member belongs to?</p>
<p>The goupOfNames object might look similiar to this:<br />
<code>dn: cn=TestGroup, o=TestOne, dc=rekk, dc=de<br />
objectClass: dcObject<br />
objectClass: groupOfNames<br />
cn: cn=TestGroup<br />
dc: dc=TestGroup<br />
description: Some test group<br />
member: uid=00001<br />
member: uid=00011<br />
member: uid=schwarz,dc=Test DC,dc=rekk,dc=de</code></p>
<p>The query would be for uid=schwarz:<br />
<code>(member=uid=schwarz,dc=Test DC,dc=rekk,dc=de)</code></p>
<p>or more specific:<br />
<code>(&amp;(objectclass=groupofnames)(member=uid=schwarz,dc=Test DC,dc=rekk,dc=de)</code></p>
<p>Also see <a href="http://www.rekk.de/bloggy/2007/ldap-query-adventures/">LDAP Query Adventures</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2009/ldap-query-to-find-groups-for-a-member/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netbeans Font Size Settings in Ubuntu</title>
		<link>http://www.rekk.de/bloggy/2009/netbeans-font-size-setting-in-ubuntu/</link>
		<comments>http://www.rekk.de/bloggy/2009/netbeans-font-size-setting-in-ubuntu/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 15:31:57 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=144</guid>
		<description><![CDATA[(ubuntu 9.04  gnome, netbeans 6.5, Java 1.6)
I assume you are familiar with: FaqNetbeansConf , Change the Font Size .
Setting the font size of your editors is easy : Tools &#8211; Options &#8211; Font and Colors .
If you want to change font size of the menues and panels of the GUI and you are using [...]]]></description>
			<content:encoded><![CDATA[<p>(ubuntu 9.04  gnome, netbeans 6.5, Java 1.6)</p>
<p>I assume you are familiar with: <a href="http://wiki.netbeans.org/FaqNetbeansConf">FaqNetbeansConf</a> , <a href="http://www.netbeans.org/kb/articles/netbeans-hacks-2.html#font-size">Change the Font Size</a> .</p>
<p>Setting the font size of your editors is easy : Tools &#8211; Options &#8211; Font and Colors .</p>
<p>If you want to change font size of the menues and panels of the GUI and you are using startup options</p>
<pre>
--laf javax.swing.plaf.metal.MetalLookAndFeel
</pre>
<p>you can set the GUI font size:</p>
<pre>
--fontsize 13
</pre>
<p>and it will work without any problems.</p>
<p>In case you are using the default GTK Theme you will find that the last option doesn&#8217;t change the font size of the menues. Here it helps to edit the ~/.gtkrc-2.0 configuration file:</p>
<pre>
# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/usr/share/themes/Qt/gtk-2.0/gtkrc"

style "user-font"
{
	font_name="Verdana 11"
}
widget_class "*" style "user-font"

gtk-theme-name="Qt"
gtk-font-name="Verdana 11"
</pre>
<p>Change entries like &#8220;Verdana 11&#8243; according to your needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2009/netbeans-font-size-setting-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Gnome Application Launcher &#8211; Run Application in Certain Directory</title>
		<link>http://www.rekk.de/bloggy/2009/gnome-application-launcher-run-application-in-certain-directory/</link>
		<comments>http://www.rekk.de/bloggy/2009/gnome-application-launcher-run-application-in-certain-directory/#comments</comments>
		<pubDate>Tue, 12 May 2009 09:20:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=136</guid>
		<description><![CDATA[This would be easy in kde, but in gnome some extra steps are needed. I changed to gnome just recently being impressed by the clarity and simplicity of the user interface. Being used to the &#8220;kde way&#8221; I needed some time to figure that out.
This is an example for kdissert:
Create a wrapper script for example [...]]]></description>
			<content:encoded><![CDATA[<p>This would be easy in kde, but in gnome some extra steps are needed. I changed to gnome just recently being impressed by the clarity and simplicity of the user interface. Being used to the &#8220;kde way&#8221; I needed some time to figure that out.</p>
<p>This is an example for kdissert:</p>
<p>Create a wrapper script for example kdissert.sh in ~/bin/launch and make it executable</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash                                                                                                     </span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Known
<span style="color: #c20cb9; font-weight: bold;">nohup</span> kdissert <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> 0</pre></div></div>

<p>Then use the panel menu to create a Custom Application Launcher : Add to panel -> Custom Application Launcher -> Choose Type: Application, Command: /home/yourusername/bin/launch/kdissert.sh </p>
<p>Another way is to use shell directly. But watch out &#8211; you will need to source your .bashrc if needed:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Desktop Entry<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">Version</span>=<span style="color: #000000;">1.0</span>
<span style="color: #007800;">Encoding</span>=UTF-<span style="color: #000000;">8</span>
<span style="color: #007800;">Name</span>=netbeans with some environment settings
<span style="color: #007800;">Exec</span>=<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">-c</span>  <span style="color: #ff0000;">'. ~/.bashrc; ~/workarea/nb_run.sh'</span>
<span style="color: #666666; font-style: italic;"># to run it in a terminal:</span>
<span style="color: #666666; font-style: italic;"># Exec=gnome-terminal --command &quot;/bin/bash -c  '. ~/.bashrc; ~/workarea/nb_run.sh' &quot;</span>
<span style="color: #007800;">Icon</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kostja<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>netbeans-6.5rc2<span style="color: #000000; font-weight: bold;">/</span>nb6.5<span style="color: #000000; font-weight: bold;">/</span>netbeans.png
<span style="color: #007800;">Categories</span>=Development;Java;IDE
<span style="color: #007800;">StartupNotify</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #007800;">Type</span>=Application</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2009/gnome-application-launcher-run-application-in-certain-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Script &#8211; Add &#124; Include only certain Files to Subversion Repository</title>
		<link>http://www.rekk.de/bloggy/2009/bash-script-add-include-only-certain-files-to-subversion-repository/</link>
		<comments>http://www.rekk.de/bloggy/2009/bash-script-add-include-only-certain-files-to-subversion-repository/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 10:43:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[build management]]></category>
		<category><![CDATA[ivy]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=122</guid>
		<description><![CDATA[Recently I had to face a limitation of subversion &#8211; you can set files and patterns for ignoring files (using svn:ignore) but you can not specify certain files or patterns for files to be included. In my situation, I wanted to build an Ivy repository and put only the ivy files under the version control [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to face a limitation of subversion &#8211; you can set files and patterns for ignoring files (using svn:ignore) but you can not specify certain files or patterns for files to be included. In my situation, I wanted to build an <a href="http://ant.apache.org/ivy/">Ivy</a> repository and put only the ivy files under the version control cause all other artifacts could be rebuild using SCM.</p>
<p>So I came up with a simple bash script, which is run just before commit and is actually called from an ant script in a build environment:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># adds only certain files to repository, adds</span>
<span style="color: #666666; font-style: italic;"># all intermediate directories on their paths,</span>
<span style="color: #666666; font-style: italic;"># it also works with empty space in path (except newline)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># @todo Add some bells and whistles!</span>
&nbsp;
<span style="color: #007800;">REPO_NAME</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>some_repo<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Running $0 on&quot;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #ff0000;">&quot;with $REPO_NAME&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># this file will help to limit the search, if it's modified on commit</span>
<span style="color: #666666; font-style: italic;"># for example the log file of last commit, the idea here is to run </span>
<span style="color: #666666; font-style: italic;"># this script always before commit</span>
<span style="color: #007800;">REF_TIME_FILE</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>some_file<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #007800;">REP_PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>some<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>copies<span style="color: #000000; font-weight: bold;">/</span>root
&nbsp;
<span style="color: #007800;">FILE_PATTERN</span>=<span style="color: #ff0000;">'ivy.xml*'</span>
<span style="color: #007800;">DIR</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$REP_PATH</span>
<span style="color: #007800;">IFS_ORIG</span>=<span style="color: #007800;">$IFS</span>
<span style="color: #666666; font-style: italic;"># this allows paths with whitespace, but not with newline</span>
<span style="color: #007800;">IFS</span>=$<span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span>
<span style="color: #666666; font-style: italic;">#IFS=&quot;$(echo)&quot; another way to get newline</span>
<span style="color: #000000; font-weight: bold;">for</span> ivy <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-newer</span> <span style="color: #007800;">$REF_TIME_FILE</span>  <span style="color: #660033;">-type</span> f  <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;$FILE_PATTERN&quot;</span>  -print<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">do</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;found fresh file $ivy&quot;</span>
	<span style="color: #007800;">p</span>=<span style="color: #007800;">$ivy</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$p</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">do</span> 
			<span style="color: #007800;">all_paths</span>=<span style="color: #800000;">${all_paths}</span><span style="color: #800000;">${del}</span><span style="color: #800000;">${p}</span>
			<span style="color: #007800;">p</span>=<span style="color: #800000;">${p%/*}</span>	
			<span style="color: #007800;">del</span>=:
	<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #007800;">IFS</span>=<span style="color: #007800;">$IFS_ORIG</span>
<span style="color: #666666; font-style: italic;">#echo $all_paths | tr ':' '\n' | sort | uniq |  tr '\n' '\0' | xargs -0 -i echo {}</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$all_paths</span> | <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">':'</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> | <span style="color: #c20cb9; font-weight: bold;">sort</span> | <span style="color: #c20cb9; font-weight: bold;">uniq</span> |  <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\0</span>'</span> | <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-0</span>  <span style="color: #c20cb9; font-weight: bold;">svn</span> add <span style="color: #660033;">--non-recursive</span>  <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> | <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^A&quot;</span>
&nbsp;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$DIR</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Finish $0 on&quot;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #ff0000;">&quot;with $REPO_NAME&quot;</span></pre></div></div>

<p>It&#8217;s not a big deal but might help you to spare some time. There might be better ways to do it and I wonder if same can be done using &#8220;plain ant&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2009/bash-script-add-include-only-certain-files-to-subversion-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PMD in Ant Problem &#8211; &#8220;Could not find class&#8221;</title>
		<link>http://www.rekk.de/bloggy/2008/pmd-in-ant-problem-could-not-find-class/</link>
		<comments>http://www.rekk.de/bloggy/2008/pmd-in-ant-problem-could-not-find-class/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 19:01:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build management]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=117</guid>
		<description><![CDATA[(ant 1.7, pmd 4.2.4)
I&#8217;ve recently tried to use PMD &#8211; sourcecode inspection tool in an ant powered build. Here is a basic example from a test in the build.xml of a Netbeans project (the pmd jar is located in ant&#8217;s home lib directory):

    &#60;target name=&#34;pmd&#34; depends=&#34;init&#34;&#62;
       [...]]]></description>
			<content:encoded><![CDATA[<p>(ant 1.7, pmd 4.2.4)</p>
<p>I&#8217;ve recently tried to use <a href="http://pmd.sourceforge.net/">PMD &#8211; sourcecode inspection tool</a> in an ant powered build. Here is a basic example from a test in the build.xml of a Netbeans project (the pmd jar is located in ant&#8217;s home lib directory):</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pmd&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #808080; font-style: italic;">&lt;!-- see http://pmd.sourceforge.net/ant-task.html --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pmd&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;net.sourceforge.pmd.ant.PMDTask&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.test.results.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pmd</span> <span style="color: #000066;">targetjdk</span>=<span style="color: #ff0000;">&quot;1.6&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #808080; font-style: italic;">&lt;!-- auxClasspath&gt; </span>
<span style="color: #808080; font-style: italic;">               &lt;pathelement location=&quot;dist/test.jar&quot; /&gt; </span>
<span style="color: #808080; font-style: italic;">            &lt;/auxClasspath --&gt;</span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ruleset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>basic<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ruleset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #808080; font-style: italic;">&lt;!-- ruleset&gt;rulesets/basic.xml&lt;/ruleset --&gt;</span>
            <span style="color: #808080; font-style: italic;">&lt;!-- ruleset&gt;rulesets/braces.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/javabeans.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/unusedcode.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/strings.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/design.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/coupling.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/codesize.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/imports.xml&lt;/ruleset&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;ruleset&gt;rulesets/naming.xml&lt;/ruleset --&gt;</span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;formatter</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xml&quot;</span> <span style="color: #000066;">toFile</span>=<span style="color: #ff0000;">&quot;${build.test.results.dir}/pmd_report.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${src.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.java&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pmd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>More examples you will find at <a href="http://pmd.sourceforge.net/ant-task.html">PMD Ant Task</a>.</p>
<p>Running this task from command line <code>ant -v pmd </code> gives a warning</p>
<p><code>[pmd] Could not find class test.hallo.Main</code></p>
<p>or running same from Netbeans (using external ant).</p>
<p><code>Could not find class test.hallo.Main<br />
java.lang.NoClassDefFoundError: org/jaxen/JaxenException<br />
        at net.sourceforge.pmd.rules.XPathRule.getRuleChainVisits(XPathRule.java:87)</code></p>
<p>After looking around for a while I found this thread <a href="http://sourceforge.net/forum/forum.php?thread_id=2268818&#038;forum_id=188192">Ant could not find class</a>.</p>
<p>Citation from there:</p>
<blockquote><p>
As far as what this will do to the PMD results&#8230; these errors come from the Type Resolution code. Only Rules which use the Type resolution capabilities even have a chance to give less than accurate results, and then only in circumstances requiring type information not apparent from the .java file directly. Finally, there only a few Rules in PMD that actively use Type Resolution right now, although I know several folks have written custom Rules using this capability.
 </p></blockquote>
<h2>Solution?</h2>
<p>PMD 5 is not out yet. But I was successful by using the latest snapshot (at time of writing)<br />
<a href="http://pmd.sourceforge.net/snapshot/maven2/pmd/pmd/5.0-SNAPSHOT/pmd-5.0-20081231.082852-77.jar">pmd-5.0-20081231.082852-77.jar</a>. Also, I had to change the target definition a little:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pmd&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pmd&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;net.sourceforge.pmd.ant.PMDTask&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.test.results.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!-- wird auch in -pre-test-run aufgerufen --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pmd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;auxClasspath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;dist/test.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/auxClasspath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #808080; font-style: italic;">&lt;!-- new path for rulesets!! --&gt;</span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ruleset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>rulesets/java/basic.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ruleset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;formatter</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xml&quot;</span> <span style="color: #000066;">toFile</span>=<span style="color: #ff0000;">&quot;${build.test.results.dir}/pmd_report.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${src.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.java&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pmd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now it&#8217;s working.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2008/pmd-in-ant-problem-could-not-find-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adaptation of Netbeans Ant Build for Integration II &#8211; Auto Increment Build/Version Number</title>
		<link>http://www.rekk.de/bloggy/2008/adaptation-of-netbeans-ant-build-for-integration-ii-auto-increment-buildversion-number/</link>
		<comments>http://www.rekk.de/bloggy/2008/adaptation-of-netbeans-ant-build-for-integration-ii-auto-increment-buildversion-number/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 00:05:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build management]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=91</guid>
		<description><![CDATA[(netbeans 6.1, external ant 1.7)
Here is a code snippet from build.xml which shows a possible way to customize your build in Netbeans by providing a version number and including it into the MANIFEST.MF of the created distribution jar. The current property version will be stored in a version.properties file. This version number will be retrieved [...]]]></description>
			<content:encoded><![CDATA[<p>(netbeans 6.1, external ant 1.7)</p>
<p>Here is a code snippet from build.xml which shows a possible way to customize your build in Netbeans by providing a version number and including it into the MANIFEST.MF of the created distribution jar. The current property version will be stored in a version.properties file. This version number will be retrieved and written back to the file. The script knows then the new version number (custom.version.property) and uses it in the jar creation task (see also<a href="http://www.rekk.de/bloggy/2008/adaptation-of-netbeans-ant-build-for-integration-copylibs-issue/"> Adaptation of Netbeans Ant Build for Integration &#8211; CopyLibs Issue</a>).</p>
<p>Dealing with version number:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;">  <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">                =================</span>
<span style="color: #808080; font-style: italic;">                Set Version Related</span>
<span style="color: #808080; font-style: italic;">                =================</span>
<span style="color: #808080; font-style: italic;">     --&gt;</span>
     <span style="color: #808080; font-style: italic;">&lt;!-- watch out! if you put version.properties file to src dirs,</span>
<span style="color: #808080; font-style: italic;">     cause the file ist copied </span>
<span style="color: #808080; font-style: italic;">     to build before it is touched by this tasks, </span>
<span style="color: #808080; font-style: italic;">     you will probably need to do some further customization --&gt;</span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;custom.version.file&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${basedir}/version.properties&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;-post-init&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #808080; font-style: italic;">&lt;!-- check if there is a version --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;available</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${custom.version.file}&quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;custom.version.available&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pre-inc-version&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span>  <span style="color: #000066;">unless</span>=<span style="color: #ff0000;">&quot;custom.version.available&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;No version file found. Creating ${custom.version.file} with Initial Version 0.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${custom.version.file}&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;version=0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;inc-version&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;pre-inc-version&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #808080; font-style: italic;">&lt;!-- increment version number --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;propertyfile</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${custom.version.file}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;version&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;int&quot;</span> <span style="color: #000066;">operation</span>=<span style="color: #ff0000;">&quot;+&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/propertyfile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #808080; font-style: italic;">&lt;!-- read version --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${custom.version.file}&quot;</span> <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;custom&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;project ${ant.project.name} released with version ${custom.version}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;-pre-jar&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;inc-version&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #808080; font-style: italic;">&lt;!-- Empty placeholder for easier customization. --&gt;</span>
        <span style="color: #808080; font-style: italic;">&lt;!-- You can override this target in the ../build.xml file. --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;clean-version&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;-do-clean&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Remove version property file&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${custom.version.file}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>(You could also use ant <a href="http://ant.apache.org/manual/CoreTasks/buildnumber.html">BuildNumber task</a>.)</p>
<p>Using the version number in jar file creation:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">                =================</span>
<span style="color: #808080; font-style: italic;">                Jar Overriding Default</span>
<span style="color: #808080; font-style: italic;">                =================</span>
<span style="color: #808080; font-style: italic;">     --&gt;</span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init,compile,-pre-jar,-post-jar&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Custom Build JAR with libs and version. See -do-jar-with-libs.&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${build.classes.dir}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build.classes.dir.resolved&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;-------------run.classpath------- ${run.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;--------- build.classes.dir.resolved ------ ${build.classes.dir.resolved}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathconvert</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;run.classpath.without.build.classes.dir&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;map</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;${build.classes.dir.resolved}&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pathconvert<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;-------- run.classpath.without.build.classes.dir ---- ${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathconvert</span> <span style="color: #000066;">pathsep</span>=<span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;jar.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chainedmapper<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;flattenmapper</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;globmapper</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;lib/*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chainedmapper<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pathconvert<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;--- build.classes.dir --- ${build.classes.dir}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${dist.dir}/lib&quot;</span> <span style="color: #000066;">flatten</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:jar</span> <span style="color: #000066;">manifest</span>=<span style="color: #ff0000;">&quot;${manifest.file}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Main-Class&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${main.class}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Class-Path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${jar.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Build-Version&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${custom.version}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j2seproject1:manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j2seproject1:jar<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>To run this application from the command line without Ant, try:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${dist.jar}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dist.jar.resolved&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>java -jar &quot;${dist.jar.resolved}&quot;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2008/adaptation-of-netbeans-ant-build-for-integration-ii-auto-increment-buildversion-number/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Visualizing Default Ant Task Dependencies for Netbeans build-impl.xml</title>
		<link>http://www.rekk.de/bloggy/2008/visualizing-default-ant-task-dependencies-for-netbeans-build-implxml/</link>
		<comments>http://www.rekk.de/bloggy/2008/visualizing-default-ant-task-dependencies-for-netbeans-build-implxml/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 17:49:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ant]]></category>
		<category><![CDATA[build management]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=83</guid>
		<description><![CDATA[(netbeans 6.1, external ant 1.7)
There are some great tools out there to generate a visual overview of the dependencies between the tasks within an ant file. Here is an example for Netbeans build-impl.xml file using Grand:
Here is the snippet from the task in my build.xml (following descriptions in Visual Documentation of Ant Dependencies in 3 [...]]]></description>
			<content:encoded><![CDATA[<p>(netbeans 6.1, external ant 1.7)</p>
<p>There are some great tools out there to generate a visual overview of the dependencies between the tasks within an ant file. Here is an example for Netbeans build-impl.xml file using <a href="http://www.ggtools.net/grand/">Grand</a>:</p>
<div id="attachment_84" class="wp-caption alignnone" style="width: 310px"><a href="http://www.rekk.de/bloggy/wp-content/uploads/2008/12/build.png"><img src="http://www.rekk.de/bloggy/wp-content/uploads/2008/12/build-300x160.png" alt="build-impl ant task dependencies" title="build-impl ant task dependencies" width="300" height="160" class="size-medium wp-image-84" /></a><p class="wp-caption-text">build-impl ant task dependencies</p></div>
<p>Here is the snippet from the task in my build.xml (following descriptions in <a href="http://www.testearly.com/2008/07/25/visual-documentation-of-ant-dependencies-in-3-simple-steps/">Visual Documentation of Ant Dependencies in 3 Simple Steps</a>):</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;visual-ant-task-dependencies&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;typedef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;net/ggtools/grand/antlib.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!-- if its in your ants lib dir, otherwise use classpath=&quot;&quot; --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;grand</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;build.dot&quot;</span> <span style="color: #000066;">buildfile</span>=<span style="color: #ff0000;">&quot;${basedir}/nbproject/build-impl.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fromnode&quot;</span> <span style="color: #000066;">node</span>=<span style="color: #ff0000;">&quot;jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
             <span style="color: #808080; font-style: italic;">&lt;!-- filter name=&quot;tonode&quot; node=&quot;xxxx&quot;/ --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/grand<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;dot&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #808080; font-style: italic;">&lt;!-- arg line=&quot;-Tpng -Gsize=11.69,8.27 -Grotate=90 -o build.png ${basedir}/build.dot&quot; / --&gt;</span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-Tpng -Gsize=23.39,16.54 -o build.png ${basedir}/build.dot&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>I uploaded the <a href="http://www.ggtools.net/files/grand/">grand.jar</a> to my ant home /lib directory. Of course you will need <a href="http://www.graphviz.org/">graphviz</a> to be installed for the dot command. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2008/visualizing-default-ant-task-dependencies-for-netbeans-build-implxml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adaptation of Netbeans Ant Build for Integration &#8211; CopyLibs Issue</title>
		<link>http://www.rekk.de/bloggy/2008/adaptation-of-netbeans-ant-build-for-integration-copylibs-issue/</link>
		<comments>http://www.rekk.de/bloggy/2008/adaptation-of-netbeans-ant-build-for-integration-copylibs-issue/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 17:55:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build management]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=73</guid>
		<description><![CDATA[(Netbeans 6.1, external ant 1.7 )
If you create a standalone Java application project (i.e. one that comes with all used external jars and libs included, so there are copied to dist/lib) in Netbeans, commit the changes to version control, checkout or update the changes to your test and integration server and try to build the [...]]]></description>
			<content:encoded><![CDATA[<p>(Netbeans 6.1, external ant 1.7 )</p>
<p>If you create a standalone Java application project (i.e. one that comes with all used external jars and libs included, so there are copied to dist/lib) in Netbeans, commit the changes to version control, checkout or update the changes to your test and integration server and try to build the same project there,  you might run into problems even if you used an external ant for building the same project in Netbeans on your local machine. (Look <a href="http://one-jar.sourceforge.net/">here</a> for an explanation why jars are not includeable in the distribution jar itself.)</p>
<p>On the integration server the libs will not be copied to the dist/lib folder. The reason is that Netbeans is using an own ant task org.netbeans.modules.java.j2seproject.copylibstask which extends import org.apache.tools.ant.taskdefs.Jar and this jar will just not be found on the integration server except you completly reconstruct your local build environment on the integration server, what will be difficult if you are using a CI system (in my case it&#8217;s hudson). So let&#8217;s have a closer look at this issue and some possible solutions:</p>
<p>There are two principal ant build files Netbeans is using during the build process: build.xml &#8211; user can edit this file, build-impl.xml &#8211; user should not edit this one. Also have a look at this post <a href="http://www.rekk.de/bloggy/2008/visualizing-default-ant-task-dependencies-for-netbeans-build-implxml/">Visualizing Default Ant Task Dependencies for Netbeans build-impl.xml</a>.</p>
<h2>Where and when the Libs are copied to dist/lib by the CopyLibs task?</h2>
<p>For that we have to look into build-impl.xml. The libs are copied when the jar target ist executed:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> </span>
<span style="color: #009900;"><span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Build JAR.&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>There are several jar related tasks, which are executed when certain conditions are valid, that means certain variables are set. The interesting task here is -do-jar-with-libraries:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init,compile,-pre-pre-jar,-pre-jar&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">if</span>=<span style="color: #ff0000;">&quot;manifest.available+main.class+mkdist.available&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;-do-jar-with-libraries&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>

<p>This task will be executed if property manifest.available+main.class+mkdist.available is set. Especially if the path to CopyLibs is set.</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;condition</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;manifest.available+main.class+mkdist.available&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;and<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;istrue</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${manifest.available+main.class}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isset</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;libs.CopyLibs.classpath&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/and<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/condition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Where does this path comes from. It is read in</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;-pre-init,-init-private,-init-libraries&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;-init-user&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${user.properties.file}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>For example from: .netbeans/6.1/build.properties.<br />
<code>libs.CopyLibs.classpath=/home/user/bin/netbeans/java2/ant/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar<br />
libs.CopyLibs.javadoc=<br />
libs.CopyLibs.maven-pom=<br />
libs.CopyLibs.src=</code><br />
That&#8217;s a problem! The build.properties file will not be found on the integration server, the properties libs.CopyLIbs.classpath and manifest.available+main.class+mkdist.available will not be set, the task -do-jar-with-libraries will not be executed.</p>
<h2>What do you need CopyLibs task for?</h2>
<p>Look at how the task is used (I included some echos for better understanding):</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init,compile,-pre-pre-jar,-pre-jar&quot;</span> <span style="color: #000066;">if</span>=<span style="color: #ff0000;">&quot;manifest.available+main.class+mkdist.available&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;-do-jar-with-libraries&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${build.classes.dir}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build.classes.dir.resolved&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;-------------run.classpath------- ${run.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;--------- build.classes.dir.resolved ------ ${build.classes.dir.resolved}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathconvert</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;run.classpath.without.build.classes.dir&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;map</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;${build.classes.dir.resolved}&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pathconvert<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;-------- run.classpath.without.build.classes.dir ---- ${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathconvert</span> <span style="color: #000066;">pathsep</span>=<span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;jar.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chainedmapper<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;flattenmapper</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init,compile,-pre-pre-jar,-pre-jar&quot;</span> <span style="color: #000066;">if</span>=<span style="color: #ff0000;">&quot;manifest.available+main.class+mkdist.available&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;-do-jar-with-libraries&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;globmapper</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;lib/*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chainedmapper<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pathconvert<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs&quot;</span> <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;${libs.CopyLibs.classpath}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;copylibs&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copylibs</span> <span style="color: #000066;">compress</span>=<span style="color: #ff0000;">&quot;${jar.compress}&quot;</span> <span style="color: #000066;">jarfile</span>=<span style="color: #ff0000;">&quot;${dist.jar}&quot;</span> <span style="color: #000066;">manifest</span>=<span style="color: #ff0000;">&quot;${manifest.file}&quot;</span> <span style="color: #000066;">runtimeclasspath</span>=<span style="color: #ff0000;">&quot;${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Main-Class&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${main.class}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Class-Path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${jar.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copylibs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>To run this application from the command line without Ant, try:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${dist.jar}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dist.jar.resolved&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>java -jar &quot;${dist.jar.resolved}&quot;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>and then study the<a href="http://www.java2s.com/Open-Source/Java-Document/IDE-Netbeans/java/org/netbeans/modules/java/j2seproject/copylibstask/CopyLibs.java.htm"> java code</a>. So not much problems here. Mainly copying some files and using standard jar functions, also providing some README file. Below I will show how you can workaround using this task.</p>
<h2>Solutions?</h2>
<p><strong>First</strong>, you could copy the CopyLibs Task jar somewhere and set the property  libs.CopyLibs.classpath in your build.xml to the appropriate location or use project.properties file which comes with the Netbeans build scripts. There are little chances that this task will change and you will have to update the CopyLibs Task jar.</p>
<p><strong>Second</strong>, you could build your standalone application using <a href="http://one-jar.sourceforge.net/">One-JAR</a> overriding the jar target from build-impl.xml.</p>
<p><strong>Third</strong>, don&#8217;t change build structure but avoid using CopyLibs task. Here is an example how to change build.xml:</p>
<p>First make macrodefs and presetdefs from build-impl.xml callable by declaring appropriate namespaces in build.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Test&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;default&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:j2seproject1</span>=<span style="color: #ff0000;">&quot;http://www.netbeans.org/ns/j2se-project/1&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:j2seproject3</span>=<span style="color: #ff0000;">&quot;http://www.netbeans.org/ns/j2se-project/3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Builds, tests, and runs the project Test.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Then redefine  the jar target a little and override it in build.xml (echos only for feedback):</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- target depends=&quot;init,compile,-pre-pre-jar,-pre-jar&quot; if=&quot;manifest.available+main.class+mkdist.available&quot; name=&quot;-do-jar-with-libraries&quot; --&gt;</span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init,compile,-pre-jar,-post-jar&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Build JAR.&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${build.classes.dir}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build.classes.dir.resolved&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;-------------run.classpath------- ${run.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;--------- build.classes.dir.resolved ------ ${build.classes.dir.resolved}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathconvert</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;run.classpath.without.build.classes.dir&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;map</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;${build.classes.dir.resolved}&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pathconvert<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;-------- run.classpath.without.build.classes.dir ---- ${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathconvert</span> <span style="color: #000066;">pathsep</span>=<span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;jar.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chainedmapper<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;flattenmapper</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;globmapper</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;lib/*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chainedmapper<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pathconvert<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;--- build.classes.dir --- ${build.classes.dir}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${dist.dir}/lib&quot;</span> <span style="color: #000066;">flatten</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${run.classpath.without.build.classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:jar</span> <span style="color: #000066;">manifest</span>=<span style="color: #ff0000;">&quot;${manifest.file}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Main-Class&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${main.class}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j2seproject1:attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Class-Path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${jar.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #808080; font-style: italic;">&lt;!-- if you deal with versions --&gt;</span>
                <span style="color: #808080; font-style: italic;">&lt;!-- j2seproject1:attribute name=&quot;Build-Version&quot; value=&quot;${version}&quot; / --&gt;</span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j2seproject1:manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j2seproject1:jar<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>To run this application from the command line without Ant, try:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${dist.jar}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dist.jar.resolved&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>java -jar &quot;${dist.jar.resolved}&quot;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>&#8230; and you&#8217;ve got rid of the annoying CopyLibs task thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2008/adaptation-of-netbeans-ant-build-for-integration-copylibs-issue/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Great Articles on Automation in Software Development</title>
		<link>http://www.rekk.de/bloggy/2008/great-articles-on-automation-in-software-development/</link>
		<comments>http://www.rekk.de/bloggy/2008/great-articles-on-automation-in-software-development/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 22:05:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=70</guid>
		<description><![CDATA[Automation for the people
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=automation+people:">Automation for the people</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2008/great-articles-on-automation-in-software-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
