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 49378 - "Add Jar/Folder" doesn't for for folders in "packaging project"
Summary: "Add Jar/Folder" doesn't for for folders in "packaging project"
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Pavel Buzek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-21 23:12 UTC by wqtnetbeans
Modified: 2006-03-24 10:15 UTC (History)
0 users

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 wqtnetbeans 2004-09-21 23:12:20 UTC
q-build 200409100847 of NB4.

In project properties of "web with existing
sources", under "build/packaging project", the
"Add Jar/Folder..." button only works with jar
files, but not folders.
Comment 1 Pavel Buzek 2004-09-22 01:13:47 UTC
The priority is set incorrectly. Please reffer to:
http://qa.netbeans.org/processes/bug_priority_guidelines.html


What exactly does not work? Can you describe what steps you did and
what step failed? Thanks.
Comment 2 wqtnetbeans 2004-09-22 03:57:57 UTC
Sorry for not being very clear earlier. Here's what I meant:

I have a verson-controlled webapp under the folder "myweb", which
looks like:

myweb/jsp/[bunch of jsp pages]
     /WEB-INF/classes/[some config files]
     /WEB-INF/lib/[bunch of jar files]

Then I have some version-controlled "resource" folders outside of "myweb":

myconf/[want to copy all the files here to "WEB-INF/classes" of the
project WAR]
myimg/[want to copy the entire folder DIRECTLY under the context root
of the project WAR]
commonlib/[want to copy some jar files into "WEB-INF/lib" of the
project WAR]

With NB4 q-build, I was able to set up a WAR project using "web with
existing sources" by giving "myweb" as the sources folder. Now when
building up the WAR, I want to:

1. copy all files under "myconf" into the "WEB-INF/classes" folder.

2. directly copy the entire "myimg" folder into the context root of
the WAR. So the structure of WAR would look like:

contextRoot/jsp
           /myimg
           /WEB-INF/classes
                   /lib

3. copy some the jar files under "mylib" into "WEB-INF/lib" folder.

I was able to do steps 1 and 3 by doing:

a. right-click the WAR project node; select "properties".
b. in the pop-up window, select "build -> packaging project"
c. to the right of "addition content to include" table window, click
the "Add Jar/Folder..." button.
d. browse to and select jar files and config files one by one, and for
each one click "Open". The selected files show up in the table as
"items" column.
e. type the "Path in WAR" column for each of the seleted "items".
(very painful here)

The problem is, for step 2, it won't allow me to "open" and copy the
entire "myimg" folder. 

Since I have more than 100 image files inside "myimg", I don't want
select each of them and type "Path in WAR" one by one as I did for
steps 1 and 3. 

Also, I noticed in the "private.properties" file, all the external
"additional content" items are referenced by their absolute paths. Is
it intentional to use absolute paths rather than relative ones to the
${basedir} of build.xml? I imagine relative paths might be more
"portable" although there is no garantee. 

I may have again done a poor job describing what's going on. Please
let me know if this doesn't make sense.

Thanks!
Comment 3 Pavel Buzek 2004-09-22 22:52:44 UTC
Thanks a lot for this detailed description!
First of all, I see that you are working with Q build from Sept 10.
Some of the issues are already fixed in newer build so I downloaded
this q-build to double check. Here are the results:

In 200409100847 you were not able to select a folder under the
Packaging Project category, this is now fixed. Unfortunately I see
that once you add a non-empty folder it will not be able to copy it.
You will get something like:
...xyz\nbproject\build-impl.xml:195: Use a fileset to copy directories.
I will take a look at that.

As for the relative vs absolute links to files this is a legitimate
bug. It is supposed to use relative links for files in project folder
(and it does) and for files in ${source.root} folder (and it does NOT).

There is a regression in trunk that it does not allow adding other
files then .jar/.zip - that is wrong. This was introduced with 47333,
I reopened 47333 and hope it will be fixed soon.
Comment 4 wqtnetbeans 2004-09-23 04:34:24 UTC
Thanks for the quick response!!!

I noticed by using the "Add Jar/Folder..." button, I can actually add
resource files other than jar files: such as JSP pages, images, etc.
(although all added files show up in the table with a little "jar icon"). 

I really appreciate this feature, and hope it'll stay, together with
adding jar files and entire folders.

Thanks again!
Comment 5 Pavel Buzek 2004-09-24 22:00:43 UTC
Everything is solved except absolute path for external files. I filed
a new issue for that: 49548 for clarity because I am going to ask for
change in projects API to make that part work.
Comment 6 wqtnetbeans 2004-09-25 22:53:44 UTC
Thank you!!
Comment 7 zikmund 2004-09-27 14:44:26 UTC
Verified in 200409270901 build.