部署示例 Spring Web MVC 项目 [英] Deploying a sample Spring Web MVC project

查看:43
本文介绍了部署示例 Spring Web MVC 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Tomcat、Maven 和 Spring Web MVC 的新手(准确地说是框架 v3).我试图构建 example 项目 mvc-basic这样我就可以将生成的 WAR 文件部署到测试服务器(不是本地)上并分析效果.

I'm new to Tomcat, Maven and Spring Web MVC (framework v3 to be precise). I was trying to build the example project mvc-basic so that I could deploy the generated WAR file on a test server (not locally) and analyse the effects.

当我在包含 pom.xml 的目录中运行 Maven 时,我看到这些模糊的错误消息.

When I run Maven in the directory containing pom.xml, I see these vague error messages.

pdedecker@linux-qhij:~/Dropbox/Unief/GWT/mvc/mvc-basic/trunk> ~/Apps/apache-maven-3.0.3/bin/mvn pom.xml
[INFO] Scanning for projects...                                                                                                                                                                      
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.springframework.samples:mvc-basic:war:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 124, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 133, column 12
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building mvc-basic 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.132s
[INFO] Finished at: Thu Apr 28 13:26:39 CEST 2011
[INFO] Final Memory: 2M/57M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "pom.xml". 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

我对编译器提到的东西知之甚少.如何生成WAR文件?我缺少哪些工具?

I have little to no knowledge about the things mentioned by the compiler. How can I generate the WAR file? Which tools am I missing?

推荐答案

您需要运行 mvn package.

WAR 文件运行后会出现在 target 子文件夹中.

WAR file will appear in target subfolder after running it.

另见:

这篇关于部署示例 Spring Web MVC 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆