Monday, 19 November 2012

Maven Commands

Build

To build a Maven based project, open your console, change to your project folder where pom.xml file is placed, and issue this command

“mvn package”

When we run “mvn package” command, it will compile source code, run unit test and pack it depends on your “packaging” tag in pom.xml file. For example,
If “packaging” = jar, it will package your project into a “jar” file and put it into your target folder

Also, when package phase is executed, all phases – “validate“, “compile” and “test“, including the current phase “package” will be executed orderly.

Clean

In Maven based project, many cached output existed in the “target” folder. so before build the project for deployment, we need to make sure to clean all the cached output so that we we will get the latest deployment To clean your project cached output, issue this command :

mvn clean

It is always recommended to run clean and package together.

Install

In Maven, use “mvn install” to package  project and deploy to local repository automatically, so that other developers can use it.

mvn install

When “install” phase is executed, all above phases “validate“, “compile“, “test“, “package“, “integration-test“, “verify” phase , including the current “install” phase will be executed orderly

It’s always recommended to run “clean” and “install” together, so that you are always deploy the latest project to your local repository.

 

 

Other commands

mvn eclipse:eclipse

mvn clean install -D maven.test.skip

1 comment:

  1. We are a third party technical support service. Avast Customer Support is here to help you out with the whole procedure to Download Avast Antivirus online, We not only fix your Avast Support related issues but will guide with how to get started with your new Avast product once it gets installed successfully. Call on our Toll Free no. 1 855 966 3855
    Gmail Customer service is a third party technical support service for Gmail users when they face any technical issue or error in their Gmail account. Our Gmail Customer Support team solves issues like forgot Gmail account password, Gmail configuration or Sync issues, recover deleted emails and many more. Toll Free number (800) 986-9271
    How you install or reinstall Office 365 or Office 2016 depends on whether your Office product is part of an Office for home or Office for business plan. If you're not sure what you have, see what office com setup products are included in each plan and then follow the steps for your product. The steps below also apply if you're installing a single, stand-alone Office application such as Access 2016 or Visio 2016. Need Help with office setup Enter Product Key? Call 1-800-000-0000 Toll Free
    Norton Tech Support is a third party service provider and not in any way associated with Norton or any of its partner companies. We offer support for Norton products and sell subscription based additional warranty on computer and other peripheral devices. Call our Toll Free number 1 855 966 3855
    Other Services
    Norton Toll Free , Office-Setup , office.com/setup.

    ReplyDelete