WTP 依赖似乎不起作用

发布于 2025-01-04 23:38:35 字数 847 浏览 3 评论 0原文

从阅读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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

中性美 2025-01-11 23:38:36

但这还不够。插件配置需要执行,这不会通过在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文