jbangdev / jbang

Unleash the power of Java - JBang Lets Students, Educators and Professional Developers create, edit and run self-contained source-only Java programs with unprecedented ease.
https://jbang.dev
MIT License
1.43k stars 159 forks source link

Allows the maven jbang plugin to inherit the project classpath (dependencies) #1411

Open cescoffier opened 2 years ago

cescoffier commented 2 years ago

Is your feature request related to a problem? Please describe.

When using the jbang maven plugin, the dependencies of the project / module are ignored. The only solution requires to duplicate the dependencies in the jbang script, but you do not:

Describe the solution you'd like

Have something like:

<useMavenClasspath>true</useMavenClasspath>

which would run the script with the module classpath.

Describe alternatives you've considered

I've tried to use the maven exec plugin, which profives this feature, but has other issues.

maxandersen commented 2 years ago

@aalmiray wdyt? is there a well defined "maven classpath" we can pass as "--deps" to jbang exec call?

maxandersen commented 2 years ago

@cescoffier according to https://www.mojohaus.org/exec-maven-plugin/java-mojo.html includeProjectDependencies seems to be the name of exec plugin. thats the behavior you are after,right?

cescoffier commented 2 years ago

Yes, you can use the same parameter name.