Explain the Maven life cycle? code example
Example 1: maven lifecycle vs runner class
What is the different between running a
test from maven and cucumber test runner class?
In my project I use cucumber + Junit. to
generate reports, I use maven-cucumber-reporting.
This report is only generated when
I run my test as a maven lifecycle verify.
Becuase this is how it works according to
its configuration.
So if I run my test from runner file,
it does not trigger the maven lifecycle.
It only runs that test. In order to run
any maven lifecycle we have to run
as a maven command which starts with 'mvn'.
Example 2: what is maven lifecycle
-CLEAN- Cleaning up the target folder
-VALIDATE - validating the project is correct and
all necessary information is available
-COMPILE - compiling 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 - taking the compiled code and package
it in its distributable format, such as a JAR.
-VERIFY - running any checks on results of
integration tests to ensure quality criteria are met
-INSTALL - install the package into the
local repository, for use as a dependency
in other projects locally
-DEPLOY - done in the build environment,
copies the final package to the remote
repository for sharing with other developers and projects.