Maven命令行使用:mvn clean compile(編譯)


先把命令行切換到Maven項目的根目錄,比如:/d/xxxwork/java/maven-test,然后執行命令:

 mvn clean compile

執行結果如下:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building rtp-front 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ rtp-front ---
[INFO] Deleting D:\xxxwork\Java\maven-test\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ rtp-front ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ rtp-front ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[INFO] Compiling 13 source files to D:\CtripWork\Java\maven-test\target\classes
[WARNING] /D:/xxxwork/Java/maven-test/src/main/java/ReadOnly.java: 某些輸入文件使用了未經檢查或不安全的操作。
[WARNING] /D:/xxxwork/Java/maven-test/src/main/java/ReadOnly.java: 有關詳細信息, 請使用 -Xlint:unchecked 重新編譯。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.500 s
[INFO] Finished at: 2016-11-14T15:15:13+08:00
[INFO] Final Memory: 13M/76M
[INFO] ------------------------------------------------------------------------

 執行順序:

1、使用清理插件:maven-clean-plugin:2.5執行清理刪除已有target目錄(版本2.5);

2、使用資源插件:maven-resources-plugin:2.6執行資源文件的復制等(版本2.6);

3、使用編譯插件:maven-compiler-plugin:3.1編譯所有源文件生成class文件至target\classes目錄下(版本3.1);

4、整個編譯過程完成。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM