Maven commonly used command meaning

  In the development process today, I changed the sql of a mapper.xml file. After restarting tomcat, it was not effective. First consider whether the remote service is turned on, resulting in the code not going local, and confirming that the remote service is closed. The modification did not take effect, so I cleaned the package where the current mapper is located, restarted tomcat, and directly reported an error:

xxx is not known to the MapperRegistry

I was confused ..., so I quickly checked the namespace of the mapper file and the configuration of the MapperScannerConfigurer, and found that they were all correct, and I was helpless for a while.

The final solution: 1. clean root project 2. package root project.

It was very uncomfortable to waste a morning time. To sum up the reason is still not familiar enough with some commands of maven.

Summary of maven commands

 

  • clean: Clear the class in the target directory under the maven project and the packaged files in the local repository.
  • validate: Verify that the project is correct and that all required resources are available.
  • compile: That is, the java files in the project are compiled and stored in the project's compilation directory.
  • test: That is, run the test case file in the project. If the test case fails, it will also fail to package. In addition, the test process here can be skipped through configuration in the pom.
  • package: Package the locally compiled files as war or jar.
  • verify: Run any checks to verify that the package is valid and meets quality standards.
  • install: Store the packaged code in the local maven repository, which can be used by other local projects.
  • site: Generate project reports, sites, and publishing sites.
  • deploy: Publish the project packaged in the local repository to the server for others to rely on.

 

Guess you like

Origin www.cnblogs.com/jxxblogs/p/12739729.html