Search code examples
mavenjenkinshudson

Maven jod LifecyclePhaseNotFoundException on jenkins


I am new to jenkins.When I try to build a maven project, I meet an exception.

     [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]

How can I deal with it? Thanks


Solution

  • I think what happened is that when you setup the Maven build step, you wrote mvn somegoal

    The maven build step already implies the mvn command. So, in the goals section only write the goal. Don't explicitly write the mvn command.