I have a Maven project in Eclipse that successfully reaches the “package” goal. In doing so it produces a jar. I need to include that jar as well as the Maven dependencies in a Java Application Run Configuration.
My problem is that when I set up the run configuration, and provide command line arguments, classes provided by Maven are not found.
How is this supposed to happen? I’ve tried exploring, experimenting and searching. I could manually add all the jars from my local .m2/repository directory as “external jars” in Eclipse, but it doesn’t seem right that I should have to do that.
You need to do
mvn installto put the .jar files in the local repository, and then add appropriate<dependency/>stanza to yourpom.xmlfile.