首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决maven构建过程中丢失的context.xml?

如何解决maven构建过程中丢失的context.xml?
EN

Stack Overflow用户
提问于 2012-09-17 13:03:48
回答 1查看 1.1K关注 0票数 2

我使用Eclipse构建了一个maven web应用程序,并在目标中设置了以下命令:install tomcat:deploy。当我构建应用程序时,我遇到了这个错误:

代码语言:javascript
复制
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building web4 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ web4 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kokhoe/workspace/web4/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ web4 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ web4 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kokhoe/workspace/web4/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ web4 ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ web4 ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ web4 ---
[INFO] Packaging webapp
[INFO] Assembling webapp [web4] in [/home/kokhoe/workspace/web4/target/web4-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/kokhoe/workspace/web4/src/main/webapp]
[INFO] Webapp assembled in [71 msecs]
[INFO] Building war: /home/kokhoe/workspace/web4/target/web4-0.0.1-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ web4 ---
[INFO] Installing /home/kokhoe/workspace/web4/target/web4-0.0.1-SNAPSHOT.war to /home/kokhoe/.m2/repository/org/huahsin/web4/0.0.1-SNAPSHOT/web4-0.0.1-SNAPSHOT.war
[INFO] Installing /home/kokhoe/workspace/web4/pom.xml to /home/kokhoe/.m2/repository/org/huahsin/web4/0.0.1-SNAPSHOT/web4-0.0.1-SNAPSHOT.pom
[INFO] 
[INFO] >>> tomcat-maven-plugin:1.1:deploy (default-cli) @ web4 >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ web4 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kokhoe/workspace/web4/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ web4 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ web4 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kokhoe/workspace/web4/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ web4 ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ web4 ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ web4 ---
[INFO] Packaging webapp
[INFO] Assembling webapp [web4] in [/home/kokhoe/workspace/web4/target/web4-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/kokhoe/workspace/web4/src/main/webapp]
[INFO] Webapp assembled in [14 msecs]
[INFO] Building war: /home/kokhoe/workspace/web4/target/web4-0.0.1-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< tomcat-maven-plugin:1.1:deploy (default-cli) @ web4 <<<
[INFO] 
[INFO] --- tomcat-maven-plugin:1.1:deploy (default-cli) @ web4 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.938s
[INFO] Finished at: Mon Sep 17 12:16:34 MYT 2012
[INFO] Final Memory: 18M/215M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project web4: Cannot find context file: /home/kokhoe/workspace/web4/target/web4-0.0.1-SNAPSHOT/META-INF/context.xml -> [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/MojoExecutionException

该错误提示缺少context.xml。我可以知道如何解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-19 11:42:05

我在maven goal中使用以下命令解决了这个问题:

install tomcat:run

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12453352

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档