2015-06-26 30 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.