maven doesnt seem to be installing with springsource tool suite - spring

I recently installed the springsource tool suite plugin for eclipse, running on windows 7. But when I open a command prompt (by typing cmd in the windows start menu) and type in:
mvn --version
I get the following response:
'mvn' is not recognized as an internal or external command, operable program, or batch file.
So I then downloaded the stand-alone version of springsource tool suite, which is not what I want. And nonetheless, I still get the same response on the command line when I type in mvn --version. Can anyone tell me how to fix this problem?
I get the same response when I type in java -version . So this might be a command prompt problem. I a following the exact syntax from web tutorials.
EDIT:
I just tried to download m2e in the eclipse marketplace, but got the message that there is nothing new to install. This seems to indicate that I have maven installed, so then how do I access it via the command line in windows 7?

You have to configure your Maven environment variable to be able to use it in the command prompt.
In your case there's no need to download the maven binars because it comes with STS, just find the Maven folder inside the STS directory.

"___" is not recognized as an internal or external command
is shown when program is not installed or the path of that program is not set (to execute from other path).
remember, in "STS", maven is not configured to work out of STS (and terminal usage is out of STS usage).
we have to install it.
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:
now "mvn" command must work.
but
in my case i had to restart STS (spring tool suit) for this to work

Related

How to check maven installed in Drools machine

I have installed Drools in my machine and we have m2 repository in our linux machine. Does that mean maven installed in my machine.
If type mvn -v its saying command not found.
I am new to this maven. Kindly help me out
Drools is a library. It does not "install". You add it as a dependency to a Java project. If you "installed" something, it's not Drools. Perhaps it's jBPM or some other application which uses Drools.
Maven is a toolchain. When you install it, the zip file includes a binary that you need to put on your path. That binary (mvn) allows you to run from the commandline.
The two are not related in any way.
If you get an error when trying to run mvn -v that the command is not recognized, that means that the Maven binary is not on your path. Find where you installed Maven, locate the 'bin' directory in that installation, and add that bin directory to your Path environment variable.
If you did not install Maven, and therefore don't have an install directory, you probably want to go do that. Don't forget to put the bin directory on your path after installing.
(A less common way of using Maven involves packaging a mvn.cmd or mvn.sh script with your project itself so that you don't need to have Maven installed globally. If this is what you're doing instead, you need to run the mvn command from the same directory as that script.)

"zsh: command not found: mvn" intellij ver 2020.2 community on Mac system

I am using IntelliJ 2020.2.4 version on mac Catalina having JDK 1.8_127. I also installed(unzipped) maven in a folder on my PC. I can get return of the version as maven 3.6.3 when I query mvn -version from mac terminal. This is the good part.
Now went in to the IntelliJ terminal and queried mvn -version, I get zsh: command not found: mvn. BTW, while typing the mvn -version command, the command is highlighted in yellow, plus a green text popup in the bottom of the terminal.
I configured in the preferences under Maven, Maven home directory as (tried) both the bundled Maven (3) and the maven I unzipped in some folder on my mac. Both did not work.
Another weird thing
-(I) is when ever I restart the IDE (only then), I see maven tab on the right hand side vertical edge by clicking which we normally run maven life cycle commands like clean, install, verify etc., Once I click on it, it simply vanishes, until I restart the IDE.
-(II)When I try maven -version can return the correct version of maven as 3.6.3 from the unzipped installation. But when I open another mac terminal, the same command returns the message in the title above. What gives ?
Is this some thing permissions issue on Mac ?
How can I either
(1) use the unzipped maven binary on my mac which is version 3.6.3 inside IntelliJ (OR)
(2) use the bundled maven with IntelliJ by default.
(a) When I go to the location of this bundled maven location like /Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/bin and invoke mvn -version I get the same result as above.
I get to ask the following:
(a) Why the bundled Maven is not working either inside IntelliJ or
directly invoked from terminal
-(b) Why the external zipped install of
Maven could not be utilized inside the IntelliJ
Seems like this in an Mac OS specific problem. This is what solved it for me:
Open a terminal and make the following:
> vim ~/.zshrc
a
export M2_HOME=/Applications/apache-maven-3.x.x
export PATH=$PATH:$M2_Home/bin/
ESC
:wq
> mvn -version
Where "/Applications/apache-maven-3.x.x" is the path and version of your downloaded und unzipped maven binary of course.
Hope this solves it for other Mac users as well.

How to build a .jar library from intellij terminal by typing "ant"?

I was able to generate a .jar file by just typing "ant" in the terminal on a mac that I was using. Now that I'm on my computer (windows) same project, same stuff, .xml file is done, but ant is not recognized neither by git-bash nor by intellij integrated terminal as a command.
I can create a .jar with another method, that's not the problem. The problem is that none of the terminals recognize "ant" commands. And I don't know how to create a .jar of a library that I want to use on another project...
I've tried:
Following these instructions http://ant.apache.org/manual/install.html to install ant but intellij already has ant and I'm able to build .xml with ant as well as create .jar by going through the project structure, artifacts, etc...
Using git-bash, using powershell, using intellij terminal
Bash:
bash: ant: command not found
Intellij:
'ant' is not recognized as an internal or external command,
operable program or batch file.
I'm pretty new to all this so all the instructions and things I've tried are confusing. I'd like to type "ant" in the terminal and a .jar file would be created for me.

'gpg.exe' is not recognized as an internal or external command, operable program or batch file - Maven Release Plugin

I just got my free Sonatype Maven repo and have been attempting to do a release. However whilst trying to do this I get an error when maven-gpg-plugin attempts to sign artifacts.
I get a ton of asterisks showing beforehand and I just press enter and then I get this issue, here's my full log: http://pastebin.com/GkLbFgBF
Here are the command line parameters I am attempting to use
clean install javadoc:javadoc javadoc:jar source:jar release:clean release:prepare release:perform
I installed gpg4win thinking that might solve this but it hasn't.
As each system is differently configured the following steps works in some cases.
when you receive this error message, “gpg is not recognized as an internal or external command” then you need to update your PATH variable.
To do this without reboot:
Open up a command prompt window
Paste this in:
SET PATH=%PATH%;C:\Program Files (x86)\GNU\GnuPG
Hit Enter
A quick and easy fix (at least for me) was to just copy the gnupg using the File Explorer interface from whatever folder it got saved to when you originally downloaded it. Then make sure it's pasted into both Program Files (x86) and Program Files folders in c: or Windows(c:)
I was getting the gpg is not recognized as an internal or external command error during a Linux Mint authentication check. Checked the PATH saw that C:\*AnyDirectory*\gnupg\bin was absent. Went to my c: folder in File Explorer and searched gnupg saw that it was in Program Files but not in Program Files (x86) fixed that now I get C:\Program Files (x86)\gnupg\bin in my PATH and the error message went away.
You can also use another plugin https://www.simplify4u.org/sign-maven-plugin/ for signing artifacts.
sign-maven-plugin does not use gpg for signing, it use java BouncyCastle for signing artifacts so you need not install gpg executable and plugin works on any operating system without special configuration.

Maven location (when installed indirectly with Netbeans/Glassfish)?

Where is the maven home directory when you install Netbeans with Glassfish? I have searched for 'mvn' in the Program Files directory and my user directory in Windows 7 but it turns up nothing.
In the Maven settings in Netbeans for 'Maven Home' it says 'Bundled' which isn't much use to me, I need the actual path to maven.
First install maven separately (and verify it by running mvn command line) and then open netbeans and navigate to Tools -> Options -> Java -> Maven (I guess you already know that but just in case) and change the 'Maven Home' path to the directory where maven is installed.
The Bundled maven could generally be found at NetBeans_install_directory/java/maven.
Example For Mac:
/Applications/NetBeans 8.2.app/Contents/Resources/NetBeans/java/maven/
Example For Windows:
C:/Program Files/Netbeans 8.2/java/maven/
Not sure what version you downloaded back then, but with version 7.3, maven is found here:
C:\Program Files (x86)\NetBeans 7.3\java\maven\
In Mac OS it is in
/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/java/maven/bin
I know its an old question but still there's also another way of seeing where mvn is installed on your Netbeans.
When you clean and build your project you can see in the console output the location of maven used. See the red circle in the screenshot /home/<user>/netbeans-8.2/java/maven/bin/mvn
The maven bundled with NetBeans located at
% NetBeans Installation Location %\java\maven
Eg: C:\Program Files\NetBeans 8.2\java\maven\bin

Resources