How to Configure Maven for NetBeans IDE in Windows 10

Posted on

Introduction

The continuation from several previous articles about configuring certain part in NetBeans IDE. In this article, the focus is about configuring maven tool. So, this article has the same purpose in order to perform specific configuration part in NetBeans IDE. Those previous articles containing configuration part exist in an article with the title of ‘How to Configure Wildfly Application Server for NetBeans IDE in Windows 10 from Windows > Services’ and it exist in this link. Another one is for configuring Wildfly Application Server configuration in NetBeans IDE exist in this link. The title of that article is  ‘How to Configure Wildfly Application Server for NetBeans IDE in Windows 10 from Tool > Server’. Another similar one for configuring Wildfly Application Server with the title of ‘How to Configure Wildfly Application Server for NetBeans IDE in Windows 10 from Tool > Server’ exist in this link.

On the other hand, this article will focus on adding maven configuration in NetBeans IDE as an example in Windows 10. In order to put it simple, maven is a tool that can now be used for building and managing any Java-based project according to the explanation in this link. In other words, maven tool in this context is important tool to support the Java development process. Performing the maven configuration is very important and it also need a pre-requirement configuration of (JDK) Java Development Kit in order to run it.

Configure Maven for NetBeans IDE in Windows 10

The configuration step of the Wildfly Application Server in NetBeans IDE exist as in the following steps :

  1. As in every configuration step, first of all just run the NetBeans IDE.

  2. Next, just access menu exist in ‘Tools’ > ‘Options’ as exist below :

    How to Configure Maven for NetBeans IDE in Windows 10
    How to Configure Maven for NetBeans IDE in Windows 10
  3. By clicking the Tools > Options following by selecting the ‘Maven’ tab, the following window configuration display will appear :

    How to Configure Maven for NetBeans IDE in Windows 10
    How to Configure Maven for NetBeans IDE in Windows 10

    The above Maven Home field already have a value available. Actually, in order to add a Maven Home field in the first time or add another new Maven Home, just click the dropdown list of Maven Home field as follow :

    How to Configure Maven for NetBeans IDE in Windows 10
    How to Configure Maven for NetBeans IDE in Windows 10
  4. Click the Browse… list in the Maven Home field, the following image will appear :

    How to Configure Maven for NetBeans IDE in Windows 10
    How to Configure Maven for NetBeans IDE in Windows 10

    Actually, it will point out to the default selected Maven Home field’s location or path. In this case, it is in the ‘C:\Program Files\NetBeans-13\netbeans\java\maven’. So, just click another path for other maven installation. But it will be wise to use the included maven installation available as one package with NetBeans IDE.

  5. Just make sure to choose the root folder of the maven folder installation. In this context, it is ‘C:\Program Files\NetBeans-13\netbeans\java\maven’ as follows :

    How to Configure Maven for NetBeans IDE in Windows 10
    How to Configure Maven for NetBeans IDE in Windows 10

    Just click Open button to select, it will then return back to the Maven tab configuration setting.

  6. Finally, in order to test the maven tool, just access the Command Prompt and type ‘mvn’ as follows :

    Microsoft Windows [Version 10.0.22000.556]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\Personal>mvn
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.046 s
    [INFO] Finished at: 2022-03-26T16:58:08+07:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException
    
    C:\Users\Personal>

One thought on “How to Configure Maven for NetBeans IDE in Windows 10

Leave a Reply