README.md 3.29 KB
Newer Older
Marc Cornellà's avatar
Marc Cornellà committed
1
# mvn plugin
Vimal Raj's avatar
Vimal Raj committed
2

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

6
Enable it by adding `mvn` to the plugins array in your zshrc file:
7

8
9
10
```zsh
plugins=(... mvn)
```
Vimal Raj's avatar
Vimal Raj committed
11
12
13

## Aliases

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

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

## mvn-color

Marc Cornellà's avatar
Marc Cornellà committed
52
53
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`.
54

Marc Cornellà's avatar
Marc Cornellà committed
55
56
57
58
59
60
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
61
`archetype:generate`. See [#5052](https://github.com/ohmyzsh/ohmyzsh/issues/5052).