gpt4 book ai didi

mysql - 在 Tomcat 应用程序的 Maven 构建期间找不到 web.xml

转载 作者:行者123 更新时间:2023-11-28 23:32:21 25 4
gpt4 key购买 nike

将 J2EE 应用程序推送到我的 OpenShift Tomcat 应用程序时,我收到以下错误:

remote: [INFO] Webapp assembled in [40 msecs]
remote: [INFO] Building war: /var/lib/openshift/54eb9daa5973ca7b9a0000d9/app- root/runtime/repo/webapps/ROOT.war
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] BUILD FAILURE
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] Total time: 4.339s
remote: [INFO] Finished at: Wed Feb 25 14:51:14 EST 2015
remote: [INFO] Final Memory: 8M/112M
remote: [INFO] ------------------------------------------------------------------------
remote: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project dragonfly: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我在 webapp/WEB-INF/web.xml 和 .openshift/config/web.xml 中有我的 web.xml

我也对 webapp 和 WebContent 感到困惑。

最佳答案

web.xml 文件必须放在src/main/webapp/WEB-INF 下。您收到的错误是因为 Maven 未在此位置找到 web.xml

此外,我会大胆猜测,但我假设 WebContent 是在您创建 Web 应用程序时由 Eclipse 生成的文件夹。如果此文件夹存在,则说明您的 Eclipse 项目配置存在问题。你应该关注Maven conventions贯穿您的项目(并使用 m2e plugin 将 Maven 特性添加到您的 Eclipse 项目中)。

关于mysql - 在 Tomcat 应用程序的 Maven 构建期间找不到 web.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28728463/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com