IDEA Maven project life cycle in the operating instructions

IDEA of the Maven project done quite a good support, there is a special Maven modules for operation of the project:

The contents of the red box on the chart that is frequently used by developers to operate, the simple English translation, that Chinese were Lifecycle (life cycle), clean (clean-up), validate (validation), compile (compile), test (test) , package (package), verify (verification), install (installation), site (set), deploy (deployment)

The Maven life cycle, the above operations: one operation must contain all the steps of its front, in other words, only completed all preceding steps, to perform this operation

Looks much, but for day to day development, the common operations, but 23 were tested and instructions for several common operations:

The following were observed from the life cycle of the IDEA Maven projects operating under the project path (compiled target folder path generated under the project, with the src directory at the same level), Maven local repository changes to draw conclusions

Project Path:

Local Warehouse:

clean- cleanup operations

Variety

Under the project path of targetthe directory has been deleted, the local warehouse before if there is an installed package of the project, will not be deleted

in conclusion

Clean out under the project path of targetthe directory (if any)

compile- compilation operation

Variety

In the path created under the project targetdirectory

in conclusion

Generating a path in the item targetdirectory, but the directory does not contain the generated packet jar or other type of package

After testing, the first will not be clean operation before compile operation, popular to say: pre-compile, target directory already exists, compile, target files in the directory the same or increase, but no less.

For example: compile before the target directory already exists and logs the log file directory exists under the classes directory, modify pom.xml configuration Before the compile, in Tag Tags excluded logs directory, but only compile after performing the operation, or to view the target directory before you can see the logs directory, not visible to conduct clean operation. And then executed after test execution clean compile, there is no table of contents of the logs

package- packaging operations

Variety

In the path created under the project targetdirectory

in conclusion

Generating a path in the item targetdirectory, the directory comprising generating a jar or other type of package

mounting operation install-

Variety

Operating on the basis of the package, after performing install, the project is deployed to a local warehouse

in conclusion

install operation, the jar package or other type of package to the local repository , for other local references dependent items

deploy- deployment operations

Install operation on the basis of the generated project a jar or other type PW deploy the package to the warehouse

PW warehouse for failing to deploy, yet so tested

  • clean operation and there is no other life cycle has relationships, life cycle before the operation is performed will not be clean operation

  • Recommended package, pre-install operation to be clean operation, or in the box, enter Execute Maven Goal: After mvn clean install, but also to clean install of the operating

  • Operations maven life cycle of the project, you can see the steps or view the log file in the IDE's console

Guess you like

Origin www.cnblogs.com/zhiyin1209/p/12628531.html