Permit entire folder of JARs to be included as one classpath entry - #9545
Permit entire folder of JARs to be included as one classpath entry #9545michaelsembwever wants to merge 1 commit into
Conversation
3bed27e to
2b152ce
Compare
|
added a few labels and restarted CI |
2b152ce to
71419c3
Compare
|
@mbien , are the CI failures real ? looking like just timeouts ? |
|
those are known to fail from time to time. Esp during full moon or the release phase. |
| final URL entry = FileUtil.urlForArchiveOrDir(kid); | ||
| // Only archives yield a URL ending in '/'; skip anything that is not | ||
| // a valid classpath root (matches the java launcher's JARs-only rule). | ||
| if (entry != null && entry.toExternalForm().endsWith("/")) { // NOI18N |
There was a problem hiding this comment.
FileUtil.isArchiveFile(url) doesn't work here?
A <classpath> path token whose last component is a filename glob (containing '*' or '?') is now expanded to the archives in the directory it names; e.g. "build/lib/*" or "build/lib/*.jar" reference every JAR in "build/lib". This mirrors the wildcard classpath syntax of the java launcher and lets a freeform project point at a folder of libraries instead of listing each JAR by its versioned filename. Tokens without a glob keep their previous meaning. The directory backing each wildcard is watched, so JARs produced by a later build are picked up automatically without editing project.xml. Change notifications are coalesced and dispatched off the file-event thread to avoid inverting lock order with listener registration. The wildcard syntax is documented in freeform-project-java-5.xsd and covered by new ClasspathsTest cases. Closes apache#6044
c9969aa to
5acb405
Compare
|
just so I understand: for this to be useful, the free form build script would probably already do some globbing to produce a valid classpath during build. Since outside of the compact java file launcher, i don't think Isn't there the danger of duplicated impls where the IDE computes the classpath order differently than the script, causing inconsistent results between editor and build? I guess the confusing aspect to me is that there is a folder of jars in a project but no classpath. Usually whatever puts the jars into that folder is also able to create classpaths. |
Permit entire folder of JARs to be included as one classpath entry
Fixes #6044
( Originally https://bz.apache.org/netbeans/show_bug.cgi?id=116185 )
Component: freeform
Minor enhancement to the freeform project (for external ant scripts).
The classpath requires full name for .jar files (since .jar files are folders themselves).
This is easily painful in many projects: as many software releases these days are putting version numbers as part of the .jar file names (e.g. javolution-5.2.3.jar). Any updates to these softwares gets .jar files renamed requiring update to project.xml.
I would like to suggest accepting folders containing .jar files in classpath and expanding it for use automatically on netbeans.
Use case/motivation
See https://github.com/apache/cassandra/blob/trunk/ide/nbproject/update-netbeans-classpaths.sh
This script only exists because of the lack of this improvement.
Click to collapse/expand PR instructions
If you're a first time contributor, see the Contributing guidelines for more information.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)