* update Troubleshooting.md

* update
This commit is contained in:
Yan Zhang 2018-07-23 16:58:50 +08:00 коммит произвёл GitHub
Родитель 4b067505a8
Коммит 18775f9eb5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 18 добавлений и 16 удалений

Просмотреть файл

@ -113,6 +113,7 @@ If you have JAVA_HOME configured through the `maven.terminal.customEnv` setting,
<details>
<summary>Default Options for Maven Command</summary>
The usage of maven executable is:
> usage: mvn [options] [<goal(s)>] [<phase(s)>]
You can use `maven.executable.options` to specify default **options** for all your maven commands executed in current project.

Просмотреть файл

@ -1,26 +1,30 @@
# Troubleshooting
## Requirements
Please make sure Maven is either in the `PATH`, or that `maven.executable.path` is pointed to its installed location. Also make sure `JAVA_HOME` is specified either in environment variables or settings.
## Backround knowledge
### Available Maven executable
By default, `mvn` command is executed directly in the terminal, which requires `mvn` can be found in system envronment `PATH`.
If you do not want to add it into `PATH`, you can specify maven executable path in settings:
```
{
"maven.executable.path": "/some-path-to-maven-home/bin/mvn"
}
```
### Where to find Error logs
#### Possible error messages
There are 2 types of command execution methods.
* **Background command**. It spawn a child process in background for your commnad, and the process is showing in status bar. E.g. generating effective pom. You can find error logs in an `Output` panel named `Maven for Java`.
* **Terminal command**. It sends plain text of your command to a terminal to execute. E.g. almost all the other maven comands. Error logs are directly printed in the corresponding terminals.
### Requirements
* **Java**. Java Runtime is essential to run Maven commands.
* **Maven / Maven Wrapper**. The extension actually leverages Maven executable file in your local machine. By default, it tries the following ones in order:
1. The absolute path specified in config `maven.executable.path` if it is not empty.
2. `mvnw` file under your workspace root folder. (If you prefer to bypass this one, you can change value of config `maven.executable.preferMavenWrapper` to `false`.)
3. `mvn` in your system's `PATH`.
## Possible error messages
Error message can be collected either **directly from the integrated terminal**, or **from `Maven for Java` output panel**.
* Maven executable file not found/set.
```
Command failed: mvn --version 'mvn' is not recognized as an internal or external command, operable program or batch file.
```
In this case, please follow above instructions to set available maven executable path.
* `M2_HOME` not correctly set.
```
Error: Command failed: mvn help:effective-pom -f "xxxxxxxxxxxx\pom.xml" -Doutput="xxxxxxxxxxxxxxx\effective-pom.xml"
@ -31,13 +35,10 @@ Error message can be collected either **directly from the integrated terminal**,
```
In this case, please follow the error message to reset a correct `M2_HOME`.
### Available Java Runtime (required by Maven)
#### Possible error messages
* `JAVA_HOME` not correctly set.
```
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
```
In this case, please specify a correct JAVA_HOME environment variable, or re-install JRE/JDK if necessary.
In this case, please specify a correct `JAVA_HOME` environment variable, or re-install JRE/JDK if necessary.