This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Freeform projects support in NetBeans is a great thing, but it has several drawbacks, very annoying for me and discouraging to freeform projects. This especially touches classpath settings. This was already a problem in 5.5, I can't believe it is not going to change in 6.0. So the problems are: 1. No possibility to specify classpath for test packages in project properties window (for IDE code completion etc). In normal circumstances, unit test classpath consists of three parts: compiled classes from source packages + classpath of source packages + additional classpath for tests; currently only the first part works, I must manually edit project.xml file to fix it; I think it should be in the following way: compiled classes and sources classpath are added automatically to tests classpath + there should be an option to specify additional test classpath in project properties dialog (as it is now for "Web Sources Classpath") 2. All jars for code completion must be enumerated explicitly. It is horrible - you must edit classpath everytime you add/remove a jar. Normally nobody enumerates explicitly jars in Ant file, instead one uses wildcards, e.g lib/*.jar. It should be done exactly the some in the IDE: either simply be able to specify a folder with jars, or be able to use wildcards in classpath settings. This would be very helpful. 3. No option of associate IDE classpath with Ant classpath by its ID from Ant. It would be the best option: good Ant file declares classpath as separate element with ID, e.g. <path id="test.classpath">. In the IDE I should be able to use this ID instead of duplicating classpath settings from Ant. 4. No option to specify Javadoc for code completion. Currently I cannot find a way to associate a Javadoc jar/zip/folder to be used at code completion by an IDE. Adding it to classpath does not work. Library Manager is also not valid in freeform projects. And definitely it is not a thing which can be defined in Ant script. So there should be separate option in freeform project properties dialog to define javadoc for code completion (proabably separate for java sources, web sources, and tests, with similar rules as classpath, i.e. test include java source automatically).
ad 1) You can define classpath for test source root the same way as for any other source root - in project customizer on Java Sources Classpath panel (if you define test source root in the first panel - Java Sources). ad 2) Might be considered as an option, but the UI for that will be kind of difficult. There would have to be some list of folders and each folder needs some include/exclude pattern definition. And of course final list of jar files will have to be displayed as well. ad 3) We've been considering that with relation to automated build script parsing to find out important locations for the project. ad 4) You can create library using Library Manager and if you specify library classpath and javadoc it will be used in code completion in editor. Changing status of the issue to Enhancement. There will be probably some changes in freeform project in major post 6.0 release.
Ad 1) Looks like you are right. Somehow I did not find out that i can use drop down list. My mistake. Ad 2) I thing simply using wildcards will be sufficient. E.g <classpath mode="compile">lib/*.jar</classpath> instead of <classpath mode="compile">lib/commons-dbcp-1.2.2.jar;lib/commons-logging-1.1.jar;lib/commons-logging-adapters-1.1.jar; ......</classpath> In project customizer the final list of jars is not needed I think: simple single entry lib/*.jar would be sufficient. Ad 3) This feature would be very useful, I think: this would lessen a need for implementing point 2. In project customizer dialog, there can be an option to either enumerate jars, or select path ID from Ant. Ad 4) I found it too. Not very intuitive, but works. But there is no word about this in any help/documentation. So points 1 and 4 are invalid (with notice for point 4 that it should be better documented). Points 2 and 3 remain.
For item 4 I've successfully created an Ant task to generate a valid Library file (valid for 5.5 at least). Here it is for whatever it is worth - is there a good Wiki location to add this as an example? <macrodef name="generate.netbean.library.file"> <attribute name="classpath" default="project.class.path"/> <attribute name="srcpath" default="project.libs.src.path"/> <attribute name="javadocpath" default="project.libs.javadoc.path"/> <sequential> <makeurl property="classpath" separator="!/</resource><resource>jar:"> <path refid="@{classpath}"/> </makeurl> <makeurl property="srcpath" separator="</resource><resource>"> <path refid="@{srcpath}"/> </makeurl> <makeurl property="javadocpath" separator="</resource><resource>"> <path refid="@{javadocpath}"/> </makeurl> <echo file="${ant.project.name}.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE library PUBLIC "-//NetBeans//DTD Library Declaration 1.0//EN" "http://www.netbeans.org/dtds/library-declaration-1_0.dtd"> <library version="1.0"> <name>${ant.project.name}</name> <type>j2se</type> <volume> <type>classpath</type> <resource>jar:${classpath}!/</resource> </volume> <volume> <type>src</type> <resource>${srcpath}</resource> </volume> <volume> <type>javadoc</type> <resource>${javadocpath}</resource> </volume> </library> ]]></echo> </sequential> </macrodef>
There is wiki topic: http://wiki.netbeans.org/wiki/view/NetBeansUserFAQ#section-NetBeansUserFAQ-FreeformProjects, do you have an account for nb wiki? Will you add it there?
Changing to TASK to include the script in nb wiki. Other mentioned points are either misunderstandings or will be addressed in Automatic projects.
Changing the default component owner to tzezula.