Maven common commands

  • mvn clean [-Dmaven.test.skip=true] Clean up compiled files, clean up target files
  • mvn compile [-Dmaven.test.skip=true] Compile home directory files
  • mvn test compiles and runs the code in the test directory
  • mvn package [-Dmaven.test.skip=true] package
  • mvn install [-Dmaven.test.skip=true] publishes the project to the local repository
  • mvn dependency:tree prints the entire dependency tree. You can check whether the project reference version has conflicts through the dependency tree.
  • mvn dependency:tree > tree.txt Export the dependency tree to the TXT file in the same directory as the project

  • mvn dependency:analyze finds unused but explicitly declared dependencies in compilation and testing    
  • mvn versions:display-dependency-updates detects if there are newer versions of each component used in pom.xml

There are many more Maven commands. I will write some of them here, and I will continue to add them later.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325563288&siteId=291194637