In JShell, how to import classpath from a Maven project

You can use the jshell-maven-plugin:

mvn com.github.johnpoth:jshell-maven-plugin:1.3:run

which will fire up a JShell session with your project’s runtime path. If you want to include your test dependencies just add -DtestClasspath to the command.

NOTE: the plugin expects the project to be built already. If not, invoke the appropriate Maven build phase before the plugin e.g:

mvn [install|compile|test-compile] com.github.johnpoth:jshell-maven-plugin:1.3:run

Source code: https://github.com/johnpoth/jshell-maven-plugin; contributions are welcome 🙂 full disclaimer: I wrote the plugin.

Enjoy!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)