Maven command summary

mvn -version : View the Maven version

mvn -v : View the Maven version

mvn compile : Compile the source code

mvn test-compile : Compile the test code

mvn test : Run the unit tests in the application

mvn site : Generate the website for project related information

mvn clean : Clear the build results in the target directory

mvn package : Generate package type (jar, war, ear, .....) files according to the project

mvn install : Install jar in the local Repository

mvn install -Dmaven.test.skip=true : skip Tested (and will skip test compile) 

mvn eclipse:eclipse : generate Eclipse project files

mvn idea:idea : generate idea project

mvn jar:jar : only jar package

mvn test -skipping compile -skipping test-compile : only test and Do not compile, do not test compile

mvn eclipse:clean: clear some system settings of eclipse

mvn jetty:run: start the embedded jetty for testing

mvn tomcat7:run: start the embedded tomcat for testing

Create a JAVA project: mvn archetype:create -DgroupId=com.happyelements -DartifactId=payment-store

Create a web project: mvn archetype:create -DgroupId=com.happyelements -DartifactId=payment-store -DarchetypeArtifactId=maven-archetype-webapp

archetype is a built-in plugin, its create task will create project skeleton, archetypeArtifactId project skeleton type, DartifactId project name

Available project skeletons are:

maven-archetype-archetype 

maven-archetype-j2ee-simple 

maven-archetype-mojo 

maven-archetype -portlet

maven-archetype-profiles

maven-archetype-quickstart

maven-archetype-simple

maven-archetype-site 

maven-archetype-site-simple

maven-archetype-webapp 

mvn resources:resources : Binding in the resource processing stage, used to copy files under src/main/resources or any other specified directory to the output directory

mvn resources:testResources : copy the resources directory under test or any other specified directory Copy to the test output directory

mvn compiler:testCompile : Compile the test class (including copy resource files)  

mvn surefire:test : Run the test case  


and publish the third-party Jar to the local library:
mvn install:install-file -DgroupId=com -DartifactId =client -Dversion=0.1.0 -Dpackaging=jar -Dfile=d:\client-0.1.0.jar


mvn deploy:deploy-file -DgroupId=com -DartifactId=client -Dversion=0.1.0 -Dpackaging=jar - Dfile=d:\client-0.1.0.jar -DrepositoryId=maven-repository-inner -Durl=ftp://xxxxxxx/opt/maven/repository/

mvn -e : Display detailed error information

mvn validate : Verify that the project is correct , all required resources are available

mvn integration-test : Process and publish the package in an environment where integration tests can run

mvn verify : Run any checks to verify that the package is valid and meets quality standards
   
mvn generate-sources : Generates any additional sources needed by the application, such as xdoclet

mvn exec:java -Dexec.mainClass=org.sonatype.mavenbook.weather.Main : The Exec plugin allows us to load the appropriate dependencies without going to the classpath In the case, run this program mvn dependency

:resolve: print out the list of resolved dependencies hibernate3:hbm2ddl : Use Hibernate3 plugin to construct database mvn mybatis-generator:generate : Use Mybatis generator to automatically generate mybatis related code (model, dao interface, mapper files) Check project dependencies: mvn dependency:list  mvn dependency:tree  mvn dependency:analyze Skip unit tests: mvn package -Dmaven.test.skip=true  Ignore unit test failures: mvn test -Dmaven.test.failure.ignore=true





















mvn help:effective-pom : show the effective POM


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326776270&siteId=291194637