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 226739 - add folder needs slash at end
Summary: add folder needs slash at end
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Zezula
Depends on:
Reported: 2013-02-26 21:17 UTC by kroisand
Modified: 2013-02-27 09:51 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description kroisand 2013-02-26 21:17:54 UTC

if I choose "Add Jar/Folder" for the libaries during compiling
and add a folder to my project (e.g. ./test/),
then in the MANIFEST.MF of the jar archive that is created, this shows up as

I copy then log4j2.xml into that directory (own task in build.xml),
but it is not recognized!!!

If I modify the MANIFEST.MF in the jar generated by netbeans
and replace "lib/test" by
i.e. add only the slash at the end,
then log4j2.xml is found!!!
(something similar is reported at

My request is:
Would it be possible to add automatically the final slash into the MANIFEST.MF
if a folder is added to the libraries of a java project???

...right now, I changed, but this requires manual editing whenever
a new "real" library is added...

G. Kroisandt
Comment 1 Tomas Zezula 2013-02-27 09:30:45 UTC
Currently the path is created by the ant pathconvert task and CopyLibs task does not support directories. For the pathconvert it's hard to add the '/' to the end of folders and not to add it to the end of the jar files (except of some heuristics like jar has an extension). However it may be possible for the CopyLibs task to fix the classpath when it's executed. There is also an requirement for the CopyLibs to support directories by creating a jar file from it and put it into lib folder, this may remove the need of your custom target in the build script.
Comment 2 kroisand 2013-02-27 09:51:16 UTC

THANK you for your quick response!!!

Do you really think that it is so hard?
In my opinion there are two things that should be changed:
1) In the, a path should be stored with the "/" at the end and it should be possible to find out whether the user adds a file or folder.

2) When generating the classpath entry in the file, one should take all the file.reference.... as they are into the lib-folder (in fact, I chose a directory foo/bar and only the directory bar was created in the lib-folder)

From 2) it becomes clear that some task must already know that such a file.reference.... in the is a folder, because a sub-folder of lib was created!

The idea with the jar-file might not work.
I had the log4j2.xml file within my project (and therefore also copied in the jar), but it was not found; maybe because it was not in the root directory of my project...
Furthermore, if it is not packed in a jar-file, it seems easier to exchange it during run-time (as log4j2 allows to change the configuration dynamically).

Gerald Kroisandt