Adrian 3873
Adrian 3873

Reputation: 175

Finding where Maven is installed

Maven seems to be installed on my workstation. I do not know Maven, but am trying to learn it. It looks like Maven uses (on Windows 7) the location C:\Users\User\.m2\repository. I have this location.

But when I try mvn --version I get nothing.

I have jdk, eclipse, jboss, jboss developer studio installed.

Is maven included in eclipse or jboss developer studio?

I can create a new maven project with jboss developer studio.

But I cannot follow the tutorials because they teach command line usage, and that does not work on my system.

Is Maven installed? Then, where is it, so I can add it to the path ( a search for 'maven' on the whole disk did not help me).

Upvotes: 11

Views: 49762

Answers (4)

Khamaseen
Khamaseen

Reputation: 374

On Windows in cmd the command 'mnv -v' rolls out its location.

Upvotes: 4

Eclipse have Maven embedded.

In order to use the mvn command, you have to download maven in your computer.

After install maven, verify if you have the environment variable in your system. To do so, open terminal and type: set to print all configured environment variables.

If you do not have the MAVEN_HOME environment variable defined (for example, MAVEN_HOME=C:\<maven path>\apache-maven-3.6.3) you have to create it (the value needs to be the folder where you installed Maven). In addition, the bin folder in Maven's folder needs to be part of your PATH. Follow this link to set the variable: https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt

If you would like that Eclipse uses your Maven installation, redirect it in Eclipse config:

  1. Window --> Preferences --> Maven --> Installations
  2. Click Add.
  3. Click in Directory and point to maven directory installed, for example: c:\<Maven path>\apache-maven-3.6.3.
  4. click Finish and select the your maven in the checkbox Apply and Close.

Upvotes: 3

devops
devops

Reputation: 9179

If you are using Eclipse you will find the maven files in your eclipse folder.

Example: C:\Program Files\IDE\Eclipse\eclipse luna\eclipse\plugins

Packages starting with org.eclipse.m2e.* are maven files. Don't remove/change them using your explorer :)

Upvotes: 0

Furqan Shakoor
Furqan Shakoor

Reputation: 163

There is no default installation location for maven. It is distributed as a zip file. If you're sure you have maven on your machine, you need to search where you extracted it. You should search for "mvn.bat" and add the containing folder to your PATH environment variable. If you can't find it, it wouldn't hurt to download it again and extract the zip anywhere on your computer. As far as "C:\Users\User.m2\repository" is concerned. That is where maven keeps the project dependencies. You will not find the binaries there.

Also, I don't think maven comes packaged with eclipse.

Upvotes: 8

Related Questions