I usually work with Eclipse and open a shell to run commands, typically build commands with Maven. Partly because I like to have a command shell open, next to the Eclipse IDE, partly because it simply works better for me than using shortcuts from the m2e plugin.
Issuing a Maven command is something like this:
Code Block | ||
---|---|---|
| ||
mvn -T 4 clean install |
...
mvn -T 4 initialize site |
...
mvn initialize license:format |
We need to do the initializing since we setup some build properties plugins (like the
...
Maven Javadoc Plugin) use. Especially for new team members remembering this is an issue. So I first started to write some documentation in our team Wiki. Now it was easier to point team members to this page, but loosing time on typing the commands remained. Therefore we started to pass an alias script around so that we can type
Code Block | ||
---|---|---|
| ||
i |
...
s |
...
l |
instead. Good point, but going back to the team wiki page to remember the shortcut (we have some more aliases than the three presented in the example) was cumbersome. Therefore we added a help alias that shows the commands and a link to the team wiki page on the console:
Code Block | ||
---|---|---|
| ||
PROMPT>h |
...
--- mvn |
...
i |
...
= mvn -T 4 clean install [args] |
...
s |
...
= mvn -T 4 initialize site [args] |
...
l |
...
= mvn initialize license:format [args] |
...
--- help |
...
h |
...
= This help. |
...
|
...
For more information please refer to: |
...
http://intranet/team/aliases |
While passing around the alias script worked at first, the editing of the Windows alias script proved to be somewhat cumbersome. You have to add the commands and the help text at two different places. Therefore we defined an XML format and let the scripts (even for different platforms) be generated.
If you want to learn more about our Maven plugin that generates alias scripts, please refer to
...
Alias Maven Plugin. If you'd like to see an example how to use the plugin, have a look at config-smartics-alias.
But the story does not end here by introducing a new tool. As soon as the alias script was put to a SCM it catched momentum. Other team members added their aliases and shared them with the team.