jbang icon indicating copy to clipboard operation
jbang copied to clipboard

Add support for multiple scripts in maven plugin

Open ennishol opened this issue 4 years ago • 3 comments

It would be cool, if maven plugin could execute multiple scripts and not just one. Something like this maybe?

<configuration>
    <scripts>
        <script>
            <path>hello1.java</path>
            <args>
                <arg>--option1=foo</arg>
            </args>
        </script>
        <script>
            <path>hello2.java</path>
            <args>
                <arg>--option2=bar</arg>
            </args>
        </script>
    </scripts>
</configuration>

BTW, Thank you for jbang! it's amazing!

ennishol avatar Nov 05 '21 08:11 ennishol

Thanks for the nice words.

I'm not convinced this is a good common approach as you'll then need to consider What exit code means for build fails will mean.

@aalmiray thoughts ?

maxandersen avatar Nov 05 '21 09:11 maxandersen

I'd expect, if one of the scripts fails, the subsequent ones would not be executed and the build would fail with the exit code of the failed script. The log would indicates which scripts where successful and which one is failed

ennishol avatar Nov 05 '21 09:11 ennishol

Allowing multiple scripts sounds like a good option to me, as the current alternative is to register a profile per script which leads to additional configuration and verbosity. If this feature were to be added to the Maven plugin then it should be added to the Gradle plugin as well, to keep up with feature parity.

aalmiray avatar Nov 05 '21 14:11 aalmiray