eclipse - 如何避免在eclipse中点击三下进入src/main/webapp?

标签 eclipse maven m2eclipse m2e eclipse-wtp

我在eclipse中搭建一个maven web app项目,maven喜欢把webapp资源放在src/main/webapp这很难导航,因为我必须点击三下才能访问 webapp 内容。

  • 单击 1 展开 src
  • 点击 2 展开主
  • 点击 3 展开 webapp

  • Example of three levels of clicks needed to navigate to webapp

    在典型的 WTP eclipse 项目中,只有 WebContent 并且是顶级文件夹,因此只需单击一下即可进入。

    是否有 eclipse 或 m2e 技巧可以使 webapp 显示为项目下的顶级元素。

    最佳答案

    如果它让您的生活更轻松,您可以覆盖 webapp 目录位置以直接挂断 ${basedir}

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <warSourceDirectory>${basedir}/webapp</warSourceDirectory>
        </configuration>
      </plugin>
    

    关于eclipse - 如何避免在eclipse中点击三下进入src/main/webapp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13040962/

    相关文章:

    c++ - g++ 将库附加到应用程序

    java - 用于集成测试的故障安全插件

    java - mvn构建编译错误

    eclipse - Maven 缺少传递依赖

    eclipse - m2eclipse:将现有 Maven 项目导入 Eclipse 时将组 id 添加到项目名称

    java: class Integer == operator 奇怪的行为

    java - eclipse 代码格式化程序

    Windows 8.1 高分辨率屏幕上的 Eclipse 界面图标非常小

    java - 以 XML 格式列出 pom 实际使用的 Maven 插件

    java - 我在eclipse中使用了m2eclipse插件,为什么导入的包仍然无法被eclipse解析?