简体   繁体   English

我的 eclipse maven 项目中没有 java 资源文件夹

[英]There is no java resources folder in my eclipse maven project

In my eclipse maven project there is no java resources folder like this.在我的 eclipse maven 项目中没有像这样的 java 资源文件夹。

在此处输入图像描述

When I create my dynamic web application there is no java resources folder in it.当我创建动态 web 应用程序时,其中没有 java 资源文件夹。 I tick the Generate web.xml deployment descriptor at the end also but there is no Java resources folder.我最后也勾选了 Generate web.xml 部署描述符,但没有 Java 资源文件夹。 Can you resolve my problem?你能解决我的问题吗?

This is my project explorer.这是我的项目浏览器。 Can you see there is no java resources folder.你能看到没有 java 资源文件夹。

在此处输入图像描述

Which eclipse version are you using?您使用的是哪个 eclipse 版本? I am using the newest stable version and the tree node "java resources" does not appear.我正在使用最新的稳定版本,并且树节点“java资源”没有出现。 It might have been called like that in older eclipse versions but I am not sure.在旧的 eclipse 版本中可能会这样称呼它,但我不确定。 The important thing is though, that you should have a tree node for "src/main/resources" or at least a hierarchical structure like重要的是,你应该有一个“src/main/resources”的树节点,或者至少有一个层次结构,比如

  • src源代码
    • main主要的
      • resources资源

You can also compare your structure with a sample project which you can create from maven archetypes.您还可以将您的结构与您可以从 maven 原型创建的示例项目进行比较。 Go to File > New > Project > Maven > Maven Project > Next > and select one of the sample archetypes like maven-archetype-webapp > enter an artifact name and finish. Go to File > New > Project > Maven > Maven Project > Next > and select one of the sample archetypes like maven-archetype-webapp > enter an artifact name and finish. Now you can see how it should be displayed in eclipse correctly.现在您可以看到它应该如何正确显示在 eclipse 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM