Detailed explanation of maven commonly used build commands

Preface

command 

compile

clean

test

package

install

deploy


 

Preface

 Maven standard directory structure

command 

 

compile

Compile and generate target file

The plugin used by the compile command

Since the principle is the same, the following command is a simple demonstration

clean

Clear, delete the target file

test

Perform unit testing, which includes the compile command

Wrote 2 unit tests

 

package

Package, which contains the test command

Into a jar package

The same can also be used as war package

It can be seen from here that the test will be executed before the package is executed, and the jar package that was previously played will still exist because the clean is not executed.

install

Packaged to the local warehouse, it can only be a jar package, which contains the package command

The local warehouse also has our package

 

deploy

Package to the private server, which contains the install command

In the same way, install will be executed first, and then packaged to the private server

So far, I will not demonstrate it. As for the integration of maven and private servers, see the following 2 articles

Maven integrates Nexus private server

Maven integrates Alibaba Cloud Cloud Product Warehouse Packages (private server) 

Guess you like

Origin blog.csdn.net/lgl782519197/article/details/108662548