Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这两个文件夹有什么区别?为什么我的 bean 必须进入资源,所以我的 web 应用程序才能工作?
src/main/java Application/Library sources src/main/resources Application/Library resources
包含您的src/main/javajava 源代码。也就是你的java包,*.java文件。
src/main/java
src/main/resources包含项目的“资源”文件。例如,属性文件、配置文件(xml、ini、conf....)它们位于项目的类路径中。
src/main/resources
通常编译的源(*.class 文件)和这些资源将在target/classes.
target/classes
您的网络应用程序源(例如 Jsp/jspx、js、html...)应该转到src/main/webapp
src/main/webapp