fix: remove index in default maven/gradle single target extraction (#3526)

Previously we'd append index 0 to extract/preprocess steps for
maven/gradle, this makes a single-target extraction not have any index
at all, which is cleaner to read.

Split apart the setup not specific to a single target into a separate
preprocess step too, for clarity.

Also add a test for multi target extraction, to actually verify all of
this.
15 files changed