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.

Bug 146736 - web/j2ee projects must upgrade CopyLibs library
Summary: web/j2ee projects must upgrade CopyLibs library
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
: 143934 (view as bug list)
Depends on: 146874
Blocks:
  Show dependency tree
 
Reported: 2008-09-10 05:31 UTC by David Konecny
Modified: 2008-11-24 10:53 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2008-09-10 05:31:26 UTC
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.
Comment 1 David Konecny 2008-09-10 06:30:54 UTC
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.
Comment 2 Tomas Zezula 2008-09-10 08:11:45 UTC
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.

Comment 3 Milan Kubec 2008-09-10 08:26:32 UTC
I like second solution better too.
Comment 4 David Konecny 2008-09-11 05:15:35 UTC
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
Comment 5 Quality Engineering 2008-09-11 17:31:59 UTC
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
Comment 6 David Konecny 2008-09-11 22:01:19 UTC
*** Issue 143934 has been marked as a duplicate of this issue. ***
Comment 7 martin_zmrhal 2008-11-24 10:53:44 UTC
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)