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.
As described in issue 133451 we need to distinguish 6.1 version of CopyLibs library from 6.5 version. 6.5 version contains one more task: <copyfiles> (added as part of issue 134642). Initially I thought this would not be needed because Web/J2EE projects were not using CopyLibs library in 6.1. And web project opened in 6.5 would automatically add (latest) CopyLibs library. But this does not work for example in scenario where J2SE project and Web project are setup to share the same dedicated libraries folder. In such a scenario CopyLibs library will be presented in the shared libraries folder and upgrade of Web project will keep the old 6.1 version and later during the build it will fail with "Problem: failed to create task or type copyfiles Cause: The name is undefined." The solution is to: * rename CopyLibs to CopyLibs1.1 (it is safe to use dot character in library name, right?) * update all references in all project types (anywhere else?) to new library name * update build-impl.xml (all project types) to use libs.CopyLibs1.1.classpath * in OpenProjectHook of J2SE only remove from classpath CopyLibs and (if it was there) replace it with CopyLibs1.1 Anything else needs to be done? J2SE project does not really needs updated CopyLibs library but not doing so could cause more confusion. At the moment result of update will keep old CopyLibs jar in sharable libraries location. Do you think it would be worthwhile to provide a way to clean it up? Would have to be an API in AntProjHelper probably and usable only by project types (and not eg. by 3rd party modules) Do you agree with this change? Any comments, suggestions? Should I pass it to FAST TRACK API review just to keep people informed? Thanks for your review guys.
Simpler alternative (some people call it hack) would be to check for presence of CopyFiles class in CopyLibs library. If not present the library is 6.1 version and in such a case remove library and (hacky part starts) physically remove jars from libraries folder and add library "CopyLibs" again. The result would be updated library to 6.5 version. This would be performed only by J2EE/Web projects. I sort of like this solution. The hacky part could be resolved properly by adding an API like "ReferenceHelper.deleteLibrary(Library)" (sort of counter part to ReferenceHelper.copyLibrary(Library)). What I like on this solution, apart from simplicity, is that it would be used only in the scenario I mentioned initially: J2SE and Web using the same libraries folder in 6.1. In all other cases J2SE would remain using whatever version it is using and new Web projects would get new 6.5 version. Again, it is up to what you guys prefer.
If you don't mind I would prefer the second solution, it's much simple (doesn't need so many changes) and it doesn't introduce a new library (CopyLibs1.1). If you decide for the first solution: Using '.' in display name is OK, file name and ant name should be CopyLibs1_1. I think the mentioned 4 steps should be enough. There is no need to do clean up.
I like second solution better too.
I implemented second solution. It is much easier than version increase solution. And it is doable even with current APIs. Thanks for your opinion guys. Fixed locally as 3b86a600922a
Integrated into 'main-golden', will be available in build *200809111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/3b86a600922a User: David Konecny <dkonecny@netbeans.org> Log: #146736 - web/j2ee projects must upgrade CopyLibs library
*** Issue 143934 has been marked as a duplicate of this issue. ***
Verified Product Version: NetBeans IDE Dev (Build 200811240201) Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)