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.
When I build the project, the resulting jar not only contains the project classes, but also 3rd party jars from the classpath. This should be optional (UI option) and not the default. It is OK to include *.properties. Also, if I have sources dir = classes dir, then the .java files are also in the resulting jar. So, normally it should include *.class and *.properties. Optionally also *.jar. Maybe jar build process first should respect ${build.classes.excludes}?
I cannot reproduce jarring of third party jar files into final project jar. What is your project setup? But including sources is a problem - ${build.classes.excludes} is actaully not used for jarring but for copying from src dir to build/classes dir. So for "regular" user it's no problem but for your custom setting (classes together with sources) it might be a problem.
Attaching the project files.
Created attachment 16411 [details] build.xml
Created attachment 16412 [details] build-impl.xml
Created attachment 16413 [details] project.xml
Created attachment 16414 [details] project.properties
Re. sources being included in the JAR - of course they will be, if you make src.dir == build.classes.dir (which is not supported). You will need to override -init-presetdef-jar to exclude **/*.java. Re. the built JAR including 3rd-party JARs, I have no idea what you're talking about (and you do not give a complete test case to reproduce), unless perhaps you mean that you are keeping copies of these JARs inside ${src.dir}, in which case this is again unsupported and you would need to manually exclude them in -init-presetdef-jar.
OK, so some stuff we do is "unsupported" or "bad style". But since these things were OK in NB 3.6 or even the default, NB 4.0 should cope better with them, or it will alienate the NB 3.6 users. For example, *.java and *.jar could be excluded by default for creating the project jar.
You had to take special steps to arrange your sources this way anyway; you forgot one step. I would like to include a property to configure an excludes list for the JAR file.
Yes, I forgot. But it was not clear to me, what to do and why. I am a NB 3.6 user, no Ant expert. I suggest to create an UI option to turn off jar creation, in addition to that exclude list.
Can be considered for E (issue #46721); too late for D.