jbang
jbang copied to clipboard
Resolution of <script> files by jbang-maven-plugin in multimodule projects
Describe the bug
When using the jbang-maven-plugin in a submodule of a multi-module maven project the <configuration>/<script> is resolved relative to the cwd of the mvn process, not relative to the submodule's pom.xml.
To Reproduce
- Create a multimaven project, with subproject
foo. - In
./foo/pom.mlconfigure the jbang plugin with a<script>my_script.java</script> - Create
./foo/my_script.java, - Invoke
mvnfrom the root project and observe that the script is not found by the plugin. - Move the script to the root project
mv ./foo/my_script.java . - Invoke
mvnfrom the root project and observe that the script is now found by the plugin.
Expected behavior
Usually file references within a pom.xml are relative to that pom.xml
JBang version
$ jbang version --verbose
[jbang] [0:188] jbang version 0.126.2
and
<groupId>dev.jbang</groupId>
<artifactId>jbang-maven-plugin</artifactId>
<version>0.0.7</version>
Additional context
While you can work around problem of finding the script using maven properties, like <script>${project.basedir}/my_script.java</script>, any filename arguments given to the script will likewise be resolved relative to the maven process cwd.
Hi @tombentley , long time no see :-)
Btw, I'm guessing this issue is better opened here https://github.com/jbangdev/jbang-maven-plugin , because I don't think it's an issue with JBang itself.
Hi @quintesse, it has been a while indeed!
I would have opened the issue in that repo (it was the first place I looked), but it doesn't appear to have issues enabled.
I found a few issues here about the maven plugin, so figured this was the place.
Hmm that's weird. Is that on purpose @maxandersen or should we enable the issues?