将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感到困惑。
答案 0 :(得分:0)
web.xml
文件必须放在src/main/webapp/WEB-INF
下。您得到的错误是因为Maven没有在此位置找到web.xml
。
另外,我会猜测,但我认为WebContent
是Eclipse在创建Web应用程序时生成的文件夹。如果存在此文件夹,则Eclipse项目配置存在问题。您应该关注Maven conventions整个项目(并使用m2e plugin将Maven性质添加到Eclipse项目中。)