<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Exploring Ant Build File Changes for Java Web Projects in NetBeans 6.1</title>
	<link>http://pronetbeans.com/archives/29</link>
	<description>The source for learning NetBeans.</description>
	<pubDate>Wed, 19 Nov 2008 03:59:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: phejl</title>
		<link>http://pronetbeans.com/archives/29#comment-388</link>
		<dc:creator>phejl</dc:creator>
		<pubDate>Mon, 31 Mar 2008 10:02:04 +0000</pubDate>
		<guid>http://pronetbeans.com/archives/29#comment-388</guid>
		<description>You are right about private.properties complications. But this is the exact reason why the server library was introduced.

Right now you are providing some j2ee jars on javac classpath - this is non-standard and you rely on implementation details of project infrastructure (What jars will be preferred for compilation in the IDE? Yours or jars provided by the registered server?). So now your project structure IS non-standard, adapted to continuous build system.

For new project you can check "Use dedicated library for server JAR files" in second step and this is exactly the thing you need. When this option is used, no change to project.properties and no special configuration of javac classpath is needed. It will work for cont. build system, in the command line and in the IDE as well.

If you have the existing project, just create new global library of "Server Library" type and put the j2ee jars there (jars you are now providing for continuous build, but which doesn't make sense for IDE usage).

After this change it should work out-of-box.</description>
		<content:encoded><![CDATA[<p>You are right about private.properties complications. But this is the exact reason why the server library was introduced.</p>
<p>Right now you are providing some j2ee jars on javac classpath - this is non-standard and you rely on implementation details of project infrastructure (What jars will be preferred for compilation in the IDE? Yours or jars provided by the registered server?). So now your project structure IS non-standard, adapted to continuous build system.</p>
<p>For new project you can check &#8220;Use dedicated library for server JAR files&#8221; in second step and this is exactly the thing you need. When this option is used, no change to project.properties and no special configuration of javac classpath is needed. It will work for cont. build system, in the command line and in the IDE as well.</p>
<p>If you have the existing project, just create new global library of &#8220;Server Library&#8221; type and put the j2ee jars there (jars you are now providing for continuous build, but which doesn&#8217;t make sense for IDE usage).</p>
<p>After this change it should work out-of-box.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://pronetbeans.com/archives/29#comment-366</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Sat, 29 Mar 2008 13:09:29 +0000</pubDate>
		<guid>http://pronetbeans.com/archives/29#comment-366</guid>
		<description>Well, if the j2ee.platform.properties property IS in private.properties, this still makes using NetBeans projects in a continuous integration server more difficult. From everything I understand, the files in the nbproject/private directory are never supposed to be checked into your source code repository. If you do a checkout of that code into a separate location or into a continuous integration server like Hudson, the j2ee.platform.classpath property is now "lost" because it was in private.properties. 

I completely understand that I CAN pass it as argument to Ant in each project's configuration in Hudson, but the question is WHY should I have to. If I have hundreds of Java projects configured in my build server, I then have to edit the configuration for each one and pass the property to ant statically. this can turn into a maintenance nightmare, especially if other required properties are added in later versions of NetBeans. 

Would the solution here be to perhaps remove the  FAIL check for the j2ee.platform.classpath property that was added in NetBeans 6.1 ? : 

&#60;fail unless=”j2ee.platform.classpath”&#62;
       The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
Either open the project in the IDE and assign the server or setup the server classpath manually.
For example like this:
   ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property “j2ee.platform.classpath” in a .properties file)
or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
 &#60;/fail&#62;

NetBeans 6.0 seemed to work fine without it. Just some thoughts.</description>
		<content:encoded><![CDATA[<p>Well, if the j2ee.platform.properties property IS in private.properties, this still makes using NetBeans projects in a continuous integration server more difficult. From everything I understand, the files in the nbproject/private directory are never supposed to be checked into your source code repository. If you do a checkout of that code into a separate location or into a continuous integration server like Hudson, the j2ee.platform.classpath property is now &#8220;lost&#8221; because it was in private.properties. </p>
<p>I completely understand that I CAN pass it as argument to Ant in each project&#8217;s configuration in Hudson, but the question is WHY should I have to. If I have hundreds of Java projects configured in my build server, I then have to edit the configuration for each one and pass the property to ant statically. this can turn into a maintenance nightmare, especially if other required properties are added in later versions of NetBeans. </p>
<p>Would the solution here be to perhaps remove the  FAIL check for the j2ee.platform.classpath property that was added in NetBeans 6.1 ? : </p>
<p>&lt;fail unless=”j2ee.platform.classpath”&gt;<br />
       The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.<br />
Either open the project in the IDE and assign the server or setup the server classpath manually.<br />
For example like this:<br />
   ant -Duser.properties.file=
<path_to_property_file> (where you put the property “j2ee.platform.classpath” in a .properties file)<br />
or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used)<br />
 &lt;/fail&gt;</p>
<p>NetBeans 6.0 seemed to work fine without it. Just some thoughts.</server_classpath></path_to_property_file>
]]></content:encoded>
	</item>
	<item>
		<title>By: phejl</title>
		<link>http://pronetbeans.com/archives/29#comment-328</link>
		<dc:creator>phejl</dc:creator>
		<pubDate>Thu, 27 Mar 2008 09:33:37 +0000</pubDate>
		<guid>http://pronetbeans.com/archives/29#comment-328</guid>
		<description>Well, you are probably supplying the platform jars on javac classpath, I suppose (otherwise the project wouldn't compile complaining about missing javax.servlet and similar).

j2ee.platform.properties is the value provided by the server, so it is placed in private.properties. It is bit dubious to place it to project.properties. You have several options.

1) When calling ant use ant -Dj2ee.platform.classpath=. This is much cleaner I would say.
2) You are using dedicated library folder
  a) new project - just select "Use dedicated library for server JAR files" in second step
  b) existing project - create server library and place your j2ee platform jars there, add the library to project (better than placing platform jars to javac classpath)</description>
		<content:encoded><![CDATA[<p>Well, you are probably supplying the platform jars on javac classpath, I suppose (otherwise the project wouldn&#8217;t compile complaining about missing javax.servlet and similar).</p>
<p>j2ee.platform.properties is the value provided by the server, so it is placed in private.properties. It is bit dubious to place it to project.properties. You have several options.</p>
<p>1) When calling ant use ant -Dj2ee.platform.classpath=. This is much cleaner I would say.<br />
2) You are using dedicated library folder<br />
  a) new project - just select &#8220;Use dedicated library for server JAR files&#8221; in second step<br />
  b) existing project - create server library and place your j2ee platform jars there, add the library to project (better than placing platform jars to javac classpath)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
