Overview

This plugin for Maven creates alias scripts from a configurations file.

So what problem does this plugin solve? Whenever you type a command in a shell, for instance

mvn clean install

you could spare time in simply using an alias like this

i

If you are using license headers that depend on generated build properties, you end up with typing

mvn initialize license:format

In addition to the number of characters to type, it is also inconvenient to remember the name of the plugin and the fact, that the initialize phase has to be called before calling the format Mojo. So an alias comes handy:

l

While creating those aliases in your environment is no rocket science, why should we not share our aliases in our team? By sharing we need to add some comments so that new team members can figure out what aliases exist and what they are good for.

This plugin generates shell scripts that set the aliases you define in an XML file (please refer to usage for details) and adds some documentation to it:

  1. By typing 'h' (default key, can be changed), the aliases with their commands are printed.
  2. A URL to a team page on the wiki or CMS is printed for further information.
  3. A report plugin generates a report with the help on each alias to be referenced.

Accessing generated Scripts

The scripts are usually bundled with the artifact of the project that provides the documentation (see usage page on how to do this). Therefore download the scripts from the team's artifact server.

The scripts can also be made available via the Maven site. Currently we provide no Maven plugin to do this. Therefore your use a build script to copy the alias-scripts folder to the site and add links to it manually.

Supported Script Types

The following script types are currently supported. The script types select the scripts to be created by this plugin and are selected via the scripts parameter.

windows

Creates a script for the Windows environment.

Use

reg add "hkcu\software\microsoft\command processor" /v Autorun /t reg_sz /d ABSOLUTE_PATH_TO_ALIAS_SCRIPT\aliases.cmd

to register this script to make the aliases available in every opened Windows command shell. Replace PATH_TO_ALIAS_SCRIPT with the path to the script. aliases.cmd is the generated file in the target folder that is named windows per default.

Please note that using the file windows does not work. Rename it to alias.cmd (or any other file with an extension cmd or bat)!

Please note that a relative path does not work. An absolute path to the script file is required!

bash

Creates a script for the Linux Bash shell.

Add the aliases to your ~/.bashrc or source it from ~/.bash_profile like this:

source PATH_TO_ALIAS_SCRIPT/bash

Replace PATH_TO_ALIAS_SCRIPT with the path to the script. bash is the generated file in the target folder.

For further information please refer to the Bash Beginners Guide.