2015-06-26 70 views
-1

我正在使用maven作爲構建工具並運行一些集成測試用例。我使用System.out.println()在我的測試用例中記錄了一些語句,並做了mvn verify甚至我沒有clean install/package這個jar。這些變化反映了日誌記錄。 mvn是否確實隱含地執行了install/package或者它不需要構建jar。如果任何人有任何想法,請分享。爲什麼system.out.println更改反映沒有構建jar?

+0

測試測試代碼;它不包裝它。 –

+0

查看[構建生命週期](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html):驗證是在包後但在安裝之前。在你的情況下,包是足夠的,因爲這是當罐子被建立... – assylias

+0

@Dave:我知道測試測試代碼,因此我問了這個問題如何記錄器語句反映沒有建立罐子。 –

回答

0

看看MVN建立訂單生命週期(上述所有被使用)https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

validate   - validate the project is correct and all necessary information is available 
compile   - compile the source code of the project 
test    - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed 
package   - take the compiled code and package it in its distributable format, such as a JAR. 
integration-test - process and deploy the package if necessary into an environment where integration tests can be run 
verify   - run any checks to verify the package is valid and meets quality criteria 
install   - install the package into the local repository, for use as a dependency in other projects locally 
deploy   - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.