I’m very new to maven and I have a single java file which depends on other jar’s etc. And for that particular class I have a set of test cases that is running.
I defined the pom.xml file and everything seems to be working fine.
But I’m confused about the lifephase concepts. Now I’m giving only compile as my life phase. But that means it wont run my test cases? ( note that I’m following the convention of maven as it is with my folder structure )
I wish I could do both the life-phases compile and test at same time.
Is that possible?
If you specify a lifecycle phase like this
it will run ALL lifecycle phases in order up to and including the one you specifiy. This also means that
is not necessary since
will automatically run compile as well. For a full, ordered list of all lifecycle phases just run
and check out the help. Fyi for the default lifecycle the phases are in order:
validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy