04 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 -


4 comments:

  1. Knowledge about the latest and vital technology would increase one's self esteem to the core at the time of lagging confidence. The content presented here is quite resembling the same. You have done a great job by sharing this in here.

    JAVA Training in Chennai | JAVA Course in Chennai

    ReplyDelete
  2. Responsive desing can yield a very good revenue to a business. It has been discovered since the usage of multiple devices increase. The content furnished above too tells the same. Thanks for sharing this information in here. Please keep bloging content like this.

    Web designing course in chennai | Web designing courses | PHP Training in Chennai

    ReplyDelete
  3. The information which you have provided in this blog is really useful to everyone. Thanks for sharing.

    Full Stack Online Training

    Full Stack Training

    ReplyDelete
  4. -bash: clean: command not found
    i got this error

    ReplyDelete