Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Eclipse embedded Maven installation from the command line?

I am using STS (the Eclipse version for Spring) and it use the Maven plugin. It works fine but this Maven version is embedded into Eclipse.

Now I have to use it from the shell (the DOS prompt). If I try to perfrom thje mvn clean statment I obtain this error message:

C:\Users\Andrea\Documents\workspaces\Real-Time\ud381\lesson1\stage1>mvn
"mvn" non è riconosciuto come comando interno o esterno,
 un programma eseguibile o un file batch.

This is in Italian languange and it simply say that it can't find an internal or external mvn command.

So I think that I have to add it to the PATH environment Windows variable so I will can use it inside the command prompt.

The problem is that I can't find where is this embedded Maven installation.

Where can I find it?

like image 414
AndreaNobili Avatar asked Oct 29 '15 12:10

AndreaNobili


People also ask

Is Maven embedded in Eclipse?

An embedded version of the Maven known as the Maven Embedder is already specified. This is what is used to execute Maven inside of Eclipse. If you have another installation of Maven which you would like to use instead of the Maven Embedder, you can add another Maven runtime by clicking on the Add..


1 Answers

To my knowledge, the Maven runtime that is embedded in m2 (the plug-in that provides Maven support in Eclipse) is not suited to be used outside the IDE.

You will have to install regular Maven (available from https://maven.apache.org/download.cgi) to be able to use it from the command line. From my experience, using both in parallel works well.

Alternatively, you can use Maven wrapper in your project - thus avoiding the need to install Maven for you and your team mates.

like image 56
Rüdiger Herrmann Avatar answered Nov 01 '22 15:11

Rüdiger Herrmann