我正在尝试使用maven在maven在单独的场合构建war文件之后将war文件部署到tomcat。我使用mvn tomcat:deploy-only -X
,但maven说war文件正在部署,然后它继续说,并且永远不会停止(我确信这只是为了踢,我让它去吃午餐一次,以确保它不是大约15分钟的过程,所以这不是耐心问题。
以下是maven的输出:
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<charset default-value="ISO-8859-1">${maven.tomcat.charset}</charset>
<contextFile>${project.build.directory}/${project.build.finalName}/META-INF/context.xml</contextFile>
<ignorePackaging default-value="false">${tomcat.ignorePackaging}</ignorePackaging>
<mode default-value="war">${maven.tomcat.mode}</mode>
<packaging>${project.packaging}</packaging>
<password>${tomcat.password}</password>
<path default-value="/${project.artifactId}">${maven.tomcat.path}</path>
<server>${maven.tomcat.server}</server>
<tag>${maven.tomcat.tag}</tag>
<update default-value="false">${maven.tomcat.update}</update>
<url default-value="http://localhost:8080/manager">${maven.tomcat.url}</url>
<username>${tomcat.username}</username>
<version>${plugin.version}</version>
<warFile>${project.build.directory}/${project.build.finalName}.war</warFile>
</configuration>
[DEBUG] =======================================================================
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:deploy-only (default-cli) @ mn-stateadvantagewar ---
[DEBUG] Configuring mojo org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy-only from plugin realm ClassRealm[plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@4aad3ba4]
[DEBUG] Configuring mojo 'org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy-only' with basic configurator -->
[DEBUG] (f) charset = ISO-8859-1
[DEBUG] (f) contextFile = C:\dev\myApp\mywar\target\myapp\META-INF\context.xml
[DEBUG] (f) ignorePackaging = false
[DEBUG] (f) mode = war
[DEBUG] (f) packaging = war
[DEBUG] (f) path = /mn-stateadvantagewar
[DEBUG] (f) update = false
[DEBUG] (f) url = http://localhost:8080/manager
[DEBUG] (f) version = 1.1
[DEBUG] (f) warFile = C:\dev\myApp\mywar\target\mn-stateadvantage.war
[DEBUG] -- end configuration --
[INFO] Deploying war to http://localhost:8080/mn-stateadvantagewar
[DEBUG] No server specified for authentication - using defaults
我们使用tomcat 6.0,所以我愿意使用一些tomcat6-maven-plugin,如果你认为这会有所帮助,但我认为这是一个与tomcat版本无关的问题。这可能是我不了解的更基本的东西。
此外,如果有一个更好的方法来告诉“部署”开始后发生了什么,请告诉我。 -X参数仅显示上面的内容。没有错误,永远不会完成。
答案 0 :(得分:0)
我遇到了同样的问题,只需重新启动tomcat即可修复它。
我在localhost。{date} .log中看到了这些行但从未能跟踪它:
Feb 03, 2014 10:40:04 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: deploy: Deploying web application at '/phisApi'
Feb 03, 2014 10:40:04 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: Uploading WAR file to /var/lib/tomcat6/webapps/phisApi.war