I'm about to write a tool with which our developers can checkout sources for an artifact given its maven coordinates. The tool should be able to optionally checkout sources recursively for all SNAPSHOT dependencies as well.
My first question would be: Do I need to write this tool at all? One would imagine that this isn't a very unique user scenario, but I have yet failed to find something suitable to achieve this. I have looked at scm:checkout and scm:bootstrap, both require knowledge about the connection url where as I only have a artifactID. Is there any other way, but to write a custom tool, to do this?
If not, my home brew tool would do something in the lines of:
- Parse .m2/settings.xml to determine which repo to use Download the pom for the artefact.
- Create a temporary bootstrap-pom with the scm-tag from the downloaded pom.
- Use scm:bootstrap and the bootstrap-pom to checkout sources.
- [Optionally] Search the sources for poms with SNAPSHOT dependencies and repeat the process.
My second question would be: Does this sound like a good way to go about it to you? Any caveats spring to mind?