jbang icon indicating copy to clipboard operation
jbang copied to clipboard

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

Open cescoffier opened this issue 2 years ago • 3 comments

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:

  • no reactor resolution (requires everything to be "installed" first
  • cannot use dependency management (the versions must be duplicated)
  • can break the maven build order as why having dependencies is they are ignored

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.

cescoffier avatar Jul 20 '22 14:07 cescoffier

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

maxandersen avatar Jul 20 '22 14:07 maxandersen

@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?

maxandersen avatar Jul 20 '22 14:07 maxandersen

Yes, you can use the same parameter name.

cescoffier avatar Jul 20 '22 14:07 cescoffier