WTP 依赖似乎不起作用
从阅读Java Eclipse 无法识别使用 Maven 创建的 Web 项目
我将以下插件添加到 pom.xml 以将我的 Maven 项目转换为 Web 项目:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugin>
然后运行“更新项目配置”,但 Maven 项目未转换到一个网络项目。
如果我运行命令 mvn eclipse:eclipse -Dwtpversion=2.0
项目就会更新。更新 .pom 文件是否足以将 Maven 项目转换为 Web 项目?
From reading A Java web project created with Maven is not recognized as such by Eclipse
I add the below plugin to pom.xml to convert my maven project to a web project :
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugin>
I then run "Update Project Configuration" but the maven project is not converted to a web project.
If I run the command mvn eclipse:eclipse -Dwtpversion=2.0
the project is then updated. Should updating the .pom file not suffice to convert the maven project to a web project ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
但这还不够。插件配置需要执行,这不会通过在 Eclipse 中加载/刷新它来实现。当
mvn eclipse:eclipse
运行时它会被执行。我假设我们没有 m2e,它不需要这个配置。
It will not suffice. The plugin configuration needs to be executed, which will not happen by just loading/refreshing it in Eclipse. It gets executed when
mvn eclipse:eclipse
is run.I assume we do not have m2e, which does not need this configuration anway.