<?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! &#187; netbeans</title>
	<atom:link href="http://www.rekk.de/bloggy/category/netbeans/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>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<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 [...]]]></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<br />
<pre><pre>
--laf javax.swing.plaf.metal.MetalLookAndFeel
</pre></pre><br />
you can set the GUI font size:<br />
<pre><pre>
--fontsize 13
</pre></pre><br />
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:<br />
<pre><pre>
# This file was written by KDE
# You can edit it in the KDE control center, under &quot;GTK Styles and Fonts&quot;

include &quot;/usr/share/themes/Qt/gtk-2.0/gtkrc&quot;

style &quot;user-font&quot;
{
&nbsp;&nbsp;font_name=&quot;Verdana 11&quot;
}
widget_class &quot;*&quot; style &quot;user-font&quot;

gtk-theme-name=&quot;Qt&quot;
gtk-font-name=&quot;Verdana 11&quot;
</pre></pre><br />
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>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; &#60;!-- see http://pmd.sourceforge.net/ant-task.html --&#62; &#60;taskdef name=&#34;pmd&#34; classname=&#34;net.sourceforge.pmd.ant.PMDTask&#34;/&#62; &#60;mkdir [...]]]></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" 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><pre><code>Could not find class test.hallo.Main
java.lang.NoClassDefFoundError: org/jaxen/JaxenException
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at net.sourceforge.pmd.rules.XPathRule.getRuleChainVisits(XPathRule.java:87)</code></pre></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" 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>2</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 [...]]]></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" 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" 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 [...]]]></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" 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 [...]]]></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" 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" 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" 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" 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 />
<pre><code>libs.CopyLibs.classpath=/home/user/bin/netbeans/java2/ant/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.javadoc=
libs.CopyLibs.maven-pom=
libs.CopyLibs.src=</code></pre><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" 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" 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" 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>13</slash:comments>
		</item>
		<item>
		<title>JAXB and XML Schema in Netbeans 6.0 &#8211; Customizing</title>
		<link>http://www.rekk.de/bloggy/2008/jaxb-and-xml-schema-in-netbeans-customizing/</link>
		<comments>http://www.rekk.de/bloggy/2008/jaxb-and-xml-schema-in-netbeans-customizing/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 17:28:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JAXB]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xml schema]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=44</guid>
		<description><![CDATA[Problem:Create an XML Schema which will be binded by JAXB to a class structure following certain constrains. You have certain degrees of freedom for your schema design and later you might also use schema annotations provided by JAXB. Modularize your XML schemas, simplest example is: A.xsd uses &#38;lt;include&#38;gt; to include declarations from schema B.xsd. I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong>Create an XML Schema which will be binded by JAXB to a class structure following certain constrains. You have certain degrees of freedom for your schema design and later you  might also use schema annotations provided by JAXB. Modularize your XML schemas, simplest example is: A.xsd uses <code>&amp;lt;include&amp;gt;</code> to include declarations from schema B.xsd. </p>
<p>I want to try Netbeans&#8217; excellent schema design features. Eventually I want to publish the schemas in a WAR  deployed in a web container. That&#8217;s why I decided to put the files directly into the /web directory of the web-project.</p>
<p><strong>Proposed Solution:</strong><br />
Trying to <a href="http://www.netbeans.org/kb/60/websvc/jaxb.html">use Netbeans&#8217; JAXB Wizard</a> (or see <a href="http://wiki.netbeans.org/JAXBWizard">http://wiki.netbeans.org/JAXBWizard</a>) to create a JAXB Binding for A.xsd you will meet certain limitations: schema file changes won&#8217;t be visible to the &#8220;Regenerate&#8221; operation. You could edit the copy of A.xsd created by the JAXB Wizard in src/conf/xml-resources/jaxb/name_of_the_binding to make changes visible to the task but that will not see changes in B.xsd. The reason is that the ant tasks created by the JAXB Wizard do not provide this kind of granularity.</p>
<p>So the solution for me was to create the binding  using JAXB Wizard, then overriding the created tasks. I copied <code>&amp;lt;target name=&quot;jaxb-code-generation&quot; ... </code> from nbproject/xml_binding_build.xml to <strong>build.xml </strong>and customized the parameters of the  <a href="https://jaxb.dev.java.net/nonav/2.0.2/docs/xjcTask.html">XJC task</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;import</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;nbproject/build-impl.xml&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;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ask-something&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Do you like to customize the best IDE of all times?&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">validargs</span>=<span style="color: #ff0000;">&quot;Yes, Yes&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">addproperty</span>=<span style="color: #ff0000;">&quot;answer&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;Answer Yes! ${answer}&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>
&nbsp;
     <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;jaxb-code-generation&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;xjc-typedef-target&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/generated/addons/jaxb&quot;</span> <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/JAXBWizConfig&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/generated/jaxbCache&quot;</span> <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/JAXBWizConfig&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.classes.dir}&quot;</span> <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/JAXBWizConfig&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/generated/jaxbCache/HandleSystemBinding&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- remove catalog attribut here or change refs in catalog.xml : catalog=&quot;catalog.xml&quot; --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xjc</span> <span style="color: #000066;">package</span>=<span style="color: #ff0000;">&quot;de.gbv.examples.handesystembinding&quot;</span> <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;build/generated/jaxbCache/HandleSystemBinding&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath<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;${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;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${jaxbwiz.xjcrun.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;/classpath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-xmlschema&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-verbose&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
            <span style="color: #808080; font-style: italic;">&lt;!-- customize this --&gt;</span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;schema</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;web/A.xsd&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;depends</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;web/B.xsd&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #808080; font-style: italic;">&lt;!-- end customization --&gt;</span>
&nbsp;
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;produces</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;build/generated/jaxbCache/HandleSystemBinding&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xjc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <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;build/generated/addons/jaxb&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/generated/jaxbCache/HandleSystemBinding&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 style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;javac</span> <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${build.classes.dir}&quot;</span> <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;build/generated/addons/jaxb&quot;</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;${javac.source}&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;${javac.target}&quot;</span> <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/JAXBWizConfig&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sourcepath</span> <span style="color: #000066;">location</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;classpath</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${jaxbwiz.gensrc.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;/javac<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><b>Note:</b> Later discussions on netbeans issue tracking showed that there is a simpler way by first  running  &#8220;refresh&#8221; on the bindings schema and then doing &#8220;clean and build&#8221;. For that you don&#8217;t need to modify the ant target, nevertheless the discussed modification gives you this with just the &#8220;Regenerate&#8221; action click.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2008/jaxb-and-xml-schema-in-netbeans-customizing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Netbeans Help Browser Font Size Issue</title>
		<link>http://www.rekk.de/bloggy/2008/netbeans-help-browser-font-size-issue/</link>
		<comments>http://www.rekk.de/bloggy/2008/netbeans-help-browser-font-size-issue/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 18:15:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=43</guid>
		<description><![CDATA[Netbeans&#8217; help browser doesn&#8217;t react on font size settings (User Startup Settings ). This is an old issue which you can study here . Actually all to do is to override the default CSS settings in: netbeans-6.0/ide8/docs/org/netbeans/modules/usersguide/ide.css Download a workaround version ide.css. I had to edit this file to fit my needs (on KDE, ubuntu): [...]]]></description>
			<content:encoded><![CDATA[<p>Netbeans&#8217; help browser doesn&#8217;t react on font size settings (<a href="http://www.rekk.de/bloggy/?p=32">User Startup Settings</a> ). This is an old issue which you can study <a href="http://www.netbeans.org/issues/show_bug.cgi?id=32667">here </a>. Actually all to do is to override the default CSS settings in:<br />
<code>netbeans-6.0/ide8/docs/org/netbeans/modules/usersguide/ide.css</code><br />
Download a workaround version <a href="http://www.netbeans.org/nonav/issues/showattachment.cgi/53696/ide.css">ide.css</a>.</p>
<p>I had to edit this file to fit my needs (on KDE, ubuntu):</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15pt</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>  Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> SansSerif<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
...</pre></div></div>

<p>To see the changes you do not need to restart the IDE or something like that. Just go to another help page.</p>
<h1>Netbeans 6.5</h1>
<p>Here you the appropriate .css file is <code>ide10/docs/org/netbeans/modules/usersguide/ide.css</code> . </p>
<p>An example for a possible adaptation:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body  <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15pt</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> SansSerif<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">5</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">5</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> Black<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> White<span style="color: #00AA00;">&#125;</span>
&nbsp;
p  <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15pt</span><span style="color: #00AA00;">;</span>
     <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">5</span><span style="color: #00AA00;">;</span>
     <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">5</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
....</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2008/netbeans-help-browser-font-size-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetBeans User Configuration Settings Location on Linux</title>
		<link>http://www.rekk.de/bloggy/2007/netbeans-user-configuration-settings-location-on-linux/</link>
		<comments>http://www.rekk.de/bloggy/2007/netbeans-user-configuration-settings-location-on-linux/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 02:28:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.rekk.de/bloggy/?p=32</guid>
		<description><![CDATA[To see your currently used user directory go to Help &#8211; About &#8211; Details. To override the default settings in the file netbeans-install-dir/etc/netbeans.conf you can create a directory etc/ in /home/myhome/.netbeans/6.0 ( with 6.0 being the version number of your NetBeans installation). Then use the default netbeans.conf file from netbeans-install-dir/etc/netbeans.conf as a template to create [...]]]></description>
			<content:encoded><![CDATA[<p>To see your currently used user directory go to Help &#8211; About &#8211; Details.</p>
<p>To override the default settings in the file netbeans-install-dir/etc/netbeans.conf you can create a directory etc/ in /home/myhome/.netbeans/6.0 ( with 6.0 being the version number of your NetBeans installation). Then use the default netbeans.conf file from netbeans-install-dir/etc/netbeans.conf as a template to create a user specific settings in  /home/myhome/.netbeans/6.0/etc/netbeans.conf (see <a href="http://wiki.netbeans.info/wiki/view/FaqNetbeansConf">How do I make my custom startup parameters permanent?</a> ).</p>
<p>For instance you could change you user name (used in templates):<br />
<pre><code># Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options=&quot;-J-client -J-Xss2m -J-Xms256m -J-XX:PermSize=64m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Duser.name=&#039;My Name&#039; -J-Dapple.laf.useScreenMenuBar=true -J-Dswing.aatext=true --fontsize 14&quot;</code></pre></p>
<p>(&#8230; or use Tools -&gt; Template Manager -&gt; User configuration properties .)</p>
<p>Read more about startup parameter for Netbeans IDE in <a href="http://wiki.netbeans.org/FaqStartupParameters">FaqStartupParameters</a> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rekk.de/bloggy/2007/netbeans-user-configuration-settings-location-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

