README.md 3.1 KB
Newer Older
M
Marc Cornellà 已提交
1
# mvn plugin
V
Vimal Raj 已提交
2

M
Marc Cornellà 已提交
3 4
The mvn plugin provides many [useful aliases](#aliases) as well as completion for
the [Apache Maven](https://maven.apache.org/) command (`mvn`).
V
Vimal Raj 已提交
5

6 7 8 9
Enable it by adding `mvn` to the plugins array in your zshrc file:
```zsh
plugins=(... mvn)
```
V
Vimal Raj 已提交
10 11 12

## Aliases

M
Marc Cornellà 已提交
13
The plugin aliases mvn to a function that calls `mvnw` (the [Maven Wrapper](https://github.com/takari/maven-wrapper))
14 15
if it's found, or the mvn command otherwise.

16 17
| Alias                | Command                                         |
|:---------------------|:------------------------------------------------|
18 19 20 21 22 23
| `mvn!`               | `mvn -f <root>/pom.xml`                         |
| `mvnag`              | `mvn archetype:generate`                        |
| `mvnboot`            | `mvn spring-boot:run`                           |
| `mvnc`               | `mvn clean`                                     |
| `mvncd`              | `mvn clean deploy`                              |
| `mvnce`              | `mvn clean eclipse:clean eclipse:eclipse`       |
24
| `mvnci`              | `mvn clean install`                             |
25 26
| `mvncie`             | `mvn clean install eclipse:eclipse`             |
| `mvncini`            | `mvn clean initialize`                          |
27
| `mvncist`            | `mvn clean install -DskipTests`                 |
28
| `mvncisto`           | `mvn clean install -DskipTests --offline`       |
29
| `mvncom`             | `mvn compile`                                   |
30
| `mvncp`              | `mvn clean package`                             |
31
| `mvnct`              | `mvn clean test`                                |
32 33 34 35
| `mvncv`              | `mvn clean verify`                              |
| `mvncvst`            | `mvn clean verify -DskipTests`                  |
| `mvnd`               | `mvn deploy`                                    |
| `mvndocs`            | `mvn dependency:resolve -Dclassifier=javadoc`   |
36
| `mvndt`              | `mvn dependency:tree`                           |
37 38 39
| `mvne`               | `mvn eclipse:eclipse`                           |
| `mvnjetty`           | `mvn jetty:run`                                 |
| `mvnp`               | `mvn package`                                   |
40 41
| `mvns`               | `mvn site`                                      |
| `mvnsrc`             | `mvn dependency:sources`                        |
42 43 44 45 46 47 48
| `mvnt`               | `mvn test`                                      |
| `mvntc`              | `mvn tomcat:run`                                |
| `mvntc7`             | `mvn tomcat7:run`                               |
| `mvn-updates`        | `mvn versions:display-dependency-updates`       |

## mvn-color

M
Marc Cornellà 已提交
49 50
It's a function that wraps the mvn command to colorize it's output. You can use it in place
of the `mvn` command. For example: instead of `mvn test`, use `mvn-color test`.
51

M
Marc Cornellà 已提交
52 53 54 55 56 57
Since [Maven 3.5.0](https://maven.apache.org/docs/3.5.0/release-notes.html) the mvn command
has colored output, so this function will be soon removed from the plugin.

### Known bugs

It has a bug where it will swallow mvn prompts for user input, _e.g._ when using
58
`archetype:generate`. See [#5052](https://github.com/ohmyzsh/ohmyzsh/issues/5052).