Fork me on GitHub
#leiningen
<
2018-03-20
>
mbjarland14:03:32

@greg316 the pathing jar would not contain any binaries, only one META-INF/MANIFEST.MF file with a Class-Path: my-long-list-of-local-dependencies. This handling of dependencies is part of the java jar file specification and makes java actually add the dependencies to your classpath. The problem would then boil down to creating essentially a text file (the manifest file) with your list of dependencies pointing into your ~/.m2 directory. The only caveat here is that the java jar file specification indicates that the paths should be relative and not absolute (relative to the pathing jar). Absolute paths do work on the jvms (oracle) I tested, but I suspect this is an implementation detail. Still as a hack to get things working this might be one solution to the problem.

mbjarland14:03:35

also, the command line problem could theoretically occur on any system, on my ubuntu artful instance you get the following from ls:

~> ls -la very-long-argument-list

bash: /bin/ls: Argument list too long
if your arglist is long enough. Though admittedly I have a hard time seeing how a classpath for a project could get to ~2MB which is the limit on my machine. On the other hand, being a programmer and afflicted with a defensive mindset with a healthy sprinkling of ocd , I think it would be nice to have an execution method which is not based on assumptions about max limits like the ARG_MAX example here...they obviously still restrict some builds

mbjarland14:03:22

with all that said, it sounds to me like @ghadi’s solution on the #clojure channel where he suggests using the @ character when clojure calls java to read the classpath from a file sounds like a much cleaner solution than the pathing jar which is a bit of a hack