You’re actually mentioning what’s called classpath, which is to my understanding how classes are loaded/found etc within the environment (I a have no expertise in this field so those who are please do correct me if I am wrong).
Maven and Gradle are both build automation tools (amongst other things) that make creating and managing Java (and other language) projects (not Eclipse projects) and their binaries easier.
Noteworthy:Here are some software build automation tools laid out.
Just dropping this all here to help you understand that those are different ways of doing the same thing (ie: using Maven/Gradle/Ant. As well as using Eclipse/IntelliJ/NetBeans IDEs with or without the automation tools to manage dependencies).
I use the M2Eclipse plugin for eclipse. It allows me to import maven projects into eclipse. Once I got it as a project in eclipse, the instructions for debugging from the Docs apply, since your maven project can be treated by eclipse just as a regular Java project is.
To export the plugin as a .jar file I run maven with the “package” target. It will then compile, run tests etc and generate whatever .jars your pom.xml specifies - if it does not specify any, just a .jar of the compiled source code is generated.