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 59244

Summary: Warn user when adding folder with JAR files
Product: projects Reporter: zikmund <zikmund>
Component: LibrariesAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: blocker CC: lordpixel
Priority: P1 Keywords: UI
Version: 4.x   
Hardware: All   
OS: All   
URL: http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=53631
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 59245, 59246    

Description zikmund 2005-05-25 15:13:25 UTC
4.1 FCS

1) Create a library in library manager with a folder containing JAR files
  (do not add JAR files, but their parent directory)
2) JAR files are not used for CC/compilation in Java/Web projects - it confuses
users, see nbusers feedback: 
http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=53631

SOLUTION: When adding a folder, check it. If it contains JAR files, warn the
user that he/she should add JAR files directly.

Notice: I think that checking only files directly in the directory will be good
enough.
Comment 1 zikmund 2005-05-25 15:22:31 UTC
See similar Java project issue 59245 and Web project issue 59246 - there should
be same warning in project's Properties | Libraries | Add JAR/Folder.
Comment 2 lordpixel 2006-02-07 21:05:28 UTC
The issue is real, but the solution given is completely incorrect.

The right answer is support adding folders of JAR files to the classpath.
Currently the IDE makes a real mess out of this. Consider the following entirely
plausible setup:

some/path/repository/
    ant/ant/
          ant-1.6.jar
    apache/commons-cli/
          commons-cli-1.0.jar
    jboss/hibernate
          <a dozen or so JAR files>

... and so on for 20-30 more 3rd party libraries...

Adding these to the classpath in the IDE for a project or a library in the
library manager is extremely hard. One is forced to navigate one by one into
each folder (all 30 of them in the example above) and control-click each and
every JAR.

Contrast Ant - which solved this problem years ago:

<include path="some/path/repository/**/*.jar"/>

If the user adds a folder full of JAR files to the classpath, we should make it
work. It should mean **/*.jar. It should *not* expand the folder out to be what
it contains at the time it is added  - it should be live, updating as the user
adds and removes items from the foler.