In order to make it simpler and easier for developers to get up and going, I’ve implemented a Maven Archetype that generates a project tailor-made for our environment. The Archetype works pretty well, but fails to complete the setup on one key point: The generated project lacks a Mercurial repository.
Is there any way I can run hg init from the Archetype?
The core reason for this request is that I want to reduce the number of steps developers have to go through when creating and configuring a new product. As many as five or more modules may need to be created, each requiring its own check-in. The modules are not intended to be grouped into EAR bundles as they may be deployed independently in the architecture.
It is acceptable for the answer to be, “no, there is no solution”. This is about optimizing the zero to operational time through automation. If it can’t be automated using Maven’s mechanisms, then I would rather not implement a solution than find a sub-standard solution.
One solution that I have considered is using the ANT plugin to call hg from the command line. The part I don’t like about this solution is that it relies on the user having the Mercurial executable available in the path. That’s a dependency that could create a point of failure. Such a point of failure would complicate initial setup rather than simplifying it as intended. (Ergo, why “no solution” is a viable answer.)
Thank you to everyone for your suggestions so far!
Why not write your own Maven plugin that does the
hg initand whatever else you need? Writing basic Maven plugins like this isn’t that hard.Personally I would get the source for the scm plugin and add an
initgoal to the plugin . That would be the cleanest way to do it.Not having an
initgoal in the scm plugin looks like a glaring omission in my opinion. It might even make it back into the main code if you submit the changes.