On Fri, Jan 6, 2023 at 8:57 AM Laird Nelson <ljnel...@gmail.com> wrote:
> On Fri, Jan 6, 2023 at 8:55 AM Siddharth Jain <siddh...@gmail.com> wrote: > >> Thanks for your help. To keep the discussion focused, the ask is how to >> add >> additional dependencies/jars to the classpath when running a program using >> mvn exec:java and from what i understand it is not possible. >> > > Correction: it is possible. But actually you want to do it from the > command line only, which (as documented) would require exec-maven-plugin > 's java goal's additionalClasspathElements property to have a > corresponding user.property that you could specify with a -D flag, which, > as documented, it does not. > Finally, as documented, the exec-maven-plugin's java goal runs the designated program with the classpath of the governing Maven process, so just add items to the Maven classpath, i.e. the actual java classpath, when you start Maven. Best, Laird >