As for whether it's possible to clone an existing repository as managed.. I don't think so (but wait for those BCC'ed to correct me).. please raise a GUVNOR JIRA for future consideration.
@Walter, @Salaboy, @Toni.. anybody know?
As for the other of your enquire; there's the notion of "post build helper" that we use to deploy KJARs to the jBPM runtime (in kie-wb) following "Build & Deploy".
See
here for out usage. Implementations are injected so you should be able to write your own implementation and have it run after "Build & Deploy"...
If you want to remove the "out of the box" Build & Deploy functionality you could:-
1) Rename PostBuildHelper to BuildOperation (for example)
2) Add a sequence number to allow BuildOperations to be sequenced.
3) Move the current B&D functionality to a BuildOperation.
4) Hell.. even split the current B&D into two BuildOperations: one B the other D.
5) Move the current PostBuildHelper implementations to BuildOperation implementations sequenced to run after the primary B&D.
6) Submit a PR with your lovely changes so the wider community can enjoy :)
With kind regards,
Mike