2017-06-16 83 views
2

我已經安裝詹金斯自動部署到Tomcat 8從Maven的,但我得到這個錯誤:自動部署到Tomcat 8使用詹金斯

Waiting for Jenkins to finish collecting data[ERROR] Unknown lifecycle phase "package". 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 /root/.jenkins/workspace/mywebapp/pom.xml to com.tastyminerals.poems/poemcollection/0.0.1-SNAPSHOT/poemcollection-0.0.1-SNAPSHOT.pom 
channel stopped 
Finished: FAILURE 

Tomcat的8,Maven的3.3。 9,爪哇1.8,按照配置我在下面設置完成

的Tomcat:

<?xml version='1.0' encoding='utf-8'?> 
<tomcat-users> 
    <role rolename="manager-gui"/> 
    <role rolename="manager-script"/> 
    <user username="admin" password="password" roles="manager-gui,manager-script" /> 
</tomcat-users> 

Maven的認證在這名p ATH %MAVEN_PATH%/conf/settings.xml

<?xml version="1.0" encoding="UTF-8"?> 
<settings ...> 
    <servers> 
     <server> 
      <id>TomcatServer</id> 
      <username>admin</username> 
      <password>password</password> 
     </server> 
    </servers> 
</settings> 

<plugin> 
    <groupId>org.apache.tomcat.maven</groupId> 
    <artifactId>tomcat7-maven-plugin</artifactId> 
    <version>2.2</version> 
    <configuration> 
     <url>http://localhost:8080/manager/text</url> 
     <server>TomcatServer</server> 
     <path>/mywebapp</path> 
    </configuration> 
</plugin> 

回答

0
Waiting for Jenkins to finish collecting data[ERROR] Unknown lifecycle phase "packege". 

正是從上述消息清楚,你所提到的錯誤Maven的目標名稱。

而不是「packege」使用「包」。拼寫錯誤在那裏。

但是「包」目標只創建jar/war/ear文件,只有它不會部署到tomcat服務器。

使用tomcat7:deploy目標將工件部署到tomcat服務器。