18

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.

csss
  • 1,937
  • 2
  • 14
  • 24
  • 1
    If it's bundled you haven't installed a version can be accessed directly via command line. If you like having one just download it from maven.apache.org. – khmarbaise Dec 25 '12 at 09:36
  • 1
    The repository is located at `c:\Users\your_username\.m2\` if that helps. – unwichtich Dec 25 '12 at 12:37
  • The repository has nothing to do with the installation of the command line tool. – khmarbaise Dec 25 '12 at 14:00
  • 1
    @khmarbaise Will installing a standalone version interfere with the version already installed with netbeans? By messing up the local repository for example? – csss Dec 26 '12 at 10:19
  • No it doesn't. What do you mean by **messing up the local repository**? If you do maven builds everything which is needed for the builds will be downloaded by Maven and installed into your local repository. – khmarbaise Dec 26 '12 at 10:21

5 Answers5

34

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.

enter image description here

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/

PCM
  • 873
  • 8
  • 23
  • 2
    What? No, this isn't the correct answer, @Ashokkumar. The question asks "Where is the Maven location _when installed indirectly with Netbeans/Glassfish_", not "How can I specify which Maven installation Netbeans uses." – DavidS Mar 10 '16 at 19:29
12

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\

Andrew Mairose
  • 10,615
  • 12
  • 60
  • 102
3

In Mac OS it is in

/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/java/maven/bin
Sanandrea
  • 2,112
  • 1
  • 27
  • 45
1

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

enter image description here

CAMD_3441
  • 2,514
  • 2
  • 23
  • 38
  • 1
    your answer helped me, and i upvoted, but also i like your "circle" :) (i know i'm being very literal here, sorry for that!) – hello_earth Apr 02 '22 at 21:04
0

The maven bundled with NetBeans located at

% NetBeans Installation Location %\java\maven

Eg: C:\Program Files\NetBeans 8.2\java\maven\bin