Sunday, 4 October 2015

[ERROR] Unknown lifecycle phase "mvn"


[ERROR] Unknown lifecycle phase "mvn" You must specify a valid lifecycle phase or a goal in the format.

This Jenkins issue is very common, while configuring the maven job in jenkins. One of my peer faced this issue during her development. Then we investigate and fixed this issue.


Jenkins Configuration :-




Error Log :-

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.316 s
[INFO] Finished at: 2015-10-05T15:10:46+11:00
[INFO] Final Memory: 20M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "mvn". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: 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, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException
[JENKINS] Archiving /opt/jenkins_dev/workspace/MYAPP_BIZ/pom.xml to au.com.mycompany.group.lar.testing.biz/Myapp/0.0.1-SNAPSHOT/Myapp-0.0.1-SNAPSHOT.pom
channel stopped
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE


Solution :-

Its a simple mistake, that while configuring the jenkins jobs maven goal, we are simple trying with mvn clean install  , which is a against maven life cycle policy.

So , we fixed this by removing the mvn  . Correct command is clean install. Then it worked.




Hope it will help you. Happy Building.

Follow for more details on Google+ and @Facebook!!!



Find More Solutions -