动态Web模块3.0 - 3.1 [英] Dynamic Web Module 3.0 -- 3.1
问题描述
当我使用Maven / pom.xml构建应用程序时,我收到一个web.xml丢失的错误。
首先我尝试创建一个空的web.xml。这是项目方面改变的时刻(我不知道为什么)。它从动态Web模块3.0切换到3.1,这是不可逆转的。
如何将其重新更改为动态Web模块3.0?
此外,我无法删除JAX-RS。尝试这样做会导致:
卸载JAX-RS(REST Web Services)1.0时失败。
org.eclipse.jst.javaee.web.internal.impl.WebAppImpl无法转换为org.eclipse.jst.j2ee.webapplication.WebApp
稍后我发现我可以通过将相应的插件插入到pom.xml中来避免Maven编译错误:
<插件>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-war-plugin< / artifactId>
< version> 2.4< / version>
< configuration>
< failOnMissingWebXml> false< / failOnMissingWebXml>
< / configuration>
< / plugin>
我在日食中遇到了类似的麻烦,修改它是为了
- 删除网页模块
- 申请
- 更改模块版本
- 添加模块
- 配置(对话框底部的进一步配置可用链接)
- 应用
只需确保在应用之前配置Web模块,默认情况下将会查找您的Web文件位于/ WebContent中,这不是Maven项目结构应该如何。
编辑:
这里是第二种方式,没有其他帮助
- 退出eclipse,转到文件系统中的项目,然后到.settings文件夹。
- 打开
org.eclipse.wst.common.project.facet.core.xml
, make backup ,并删除Web模块条目。 - 您也可以在那里修改网页模块版本,但再次,不保证。
I have a mavenized codebased configured Spring 3.2.4 web app. When I build the app with Maven/pom.xml first I got an error that web.xml is missing. first I tried to create an empty web.xml. this was the moment when The project facets changed (and I don't know why). It switched from dynamic Web Module 3.0 to 3.1 and this is irreversible. How can I change it again into Dynamic Web Modules 3.0???
Additionally I can't remove the JAX-RS. Trying this it results in:
Failed while uninstalling JAX-RS (REST Web Services) 1.0.
org.eclipse.jst.javaee.web.internal.impl.WebAppImpl cannot be cast to org.eclipse.jst.j2ee.webapplication.WebApp
Later I found out that I can avoid the Maven compile error by inserting the according plugin into pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
I had similar troubles in eclipse and the only way to fix it for me was to
- Remove the web module
- Apply
- Change the module version
- Add the module
- Configure (Further configuration available link at the bottom of the dialog)
- Apply
Just make sure you configure the web module before applying it as by default it will look for your web files in /WebContent/ and this is not what Maven project structure should be.
EDIT:
Here is a second way in case nothing else helps
- Exit eclipse, go to your project in the file system, then to .settings folder.
- Open the
org.eclipse.wst.common.project.facet.core.xml
, make backup, and remove the web module entry. - You can also modify the web module version there, but again, no guarantees.
这篇关于动态Web模块3.0 - 3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!