Issue
How to execute maven commands with Spring STS manually?
I use Spring STS with build-in Maven using Linux. I need to add jar manually. I found that I need to do it by executing this command
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.1.0 -Dpackaging=jar -Dfile=ojdbc14.jar -DgeneratePom=true
It is possible to do it through windows cmd. However, by using terminal in linux I receive output:
The program 'mvn' can be found in the following packages:
* maven
* maven2
Try: apt-get install <selected package>
I don't need install another Maven when Spring STS works with an internal Maven.
How to redirect terminal to use internal Maven in Spring STS ?
On the top of my head I think to edit MAVEN_HOME, but I am beginner and I prefer to ask you guys first.
Solution
your focus:
I don't need install another Maven when Spring STS works with an internal Maven.
but, in "STS", maven is not configured to work out of STS (and terminal usage is out of STS usage).
we have to install maven.
those who are here with "mvn" is not recognised like erros,
follow the following to setup maven to work from terminal.
maven download link is here
- download latest maven from here
extract it where ever you want.
i extracted as below (see the bin,boot,conf,... folders are shown below as in the image):
as this maven download is extracted from zip file (it is not setup), you will have to add this extracted path to "PATH" variable in windows environment.
follow this to set environment path:
3.
4.
5.
6.
now "mvn" command must work.
7. in my case, i use STS
and i had to restart STS (spring tool suit) for "mvn" to work in terminal in sts
Answered By - sifr_dot_in
Answer Checked By - Mary Flores (JavaFixing Volunteer)