Eclipse无法识别src / main / webapp目录 [英] src/main/webapp directory not recognized by Eclipse
问题描述
我使用 m2eclipse 在Eclipse中导入Maven Java项目。
I use m2eclipse to import Maven Java projects in Eclipse.
无法识别 src / main / webapp
作为源目录。
在包浏览器中以图形方式(或当我查看 Java-Build-Path 在项目的属性中),
此目录不在sources文件夹列表中(而 src / main / java
或 src / main / resources
do)。
Graphically in the package explorer (or when I look into Java-Build-Path in the project's properties),
this directory isn't in the list of sources folder (while src/main/java
or src/main/resources
do).
要访问它,我必须直接查看src /目录,然后开始展开...
不太方便!
To access it, I have to look directly into the src/ directory, and start unfolding... Not very convenient!
但是,如果我运行 maven install
,资源是复制到正确的目录。
(例如: src / main / webapp / index.jsp
到 target / mywar / index .jsp
)
However, if I run maven install
, the resources are copied to the correct directory.
(example : src/main/webapp/index.jsp
to target/mywar/index.jsp
)
- 这是一个正确的行为? (我以为它可以被视为其他资源......)
- 我可以解决它吗?
- 我想知道是否还有其他缺点这种情况,我现在不知道吗?
推荐答案
- 这是正确的行为吗? (我以为它可以被视为其他资源......)
- 我可以解决它吗?
- 我想知道是否还有其他缺点这种情况,我现在不知道吗?
- 是的,对我来说这是正确的行为。
- src / main / webapp成为源文件夹并不合理,它不包含可编译的源文件。
- 我不知道。我想这取决于你的期望:))
这就是说,m2eclipse做了一个贡献,允许使 src / main / webapp
在顶层提供特定的Web资源标签,如下所示:
That said, m2eclipse made a contribution that allows to make src/main/webapp
available at the top level with a specific "Web Resources" label, something like this:
这可能是您的解决方案关注(不方便折叠)。
This could be a solution for your concern (the not convenient folding).
这篇关于Eclipse无法识别src / main / webapp目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!