Maven 的标准目录结构如下:
目录 | 说明 |
---|---|
src/main/java | Application/Library sources |
src/main/resources | Application/Library resources |
src/main/resources-filtered | Application/Library resources which are filtered. (Starting with Maven 3.4.0, not yet released.) |
src/main/filters | Resource filter files |
src/main/webapp | Web application sources |
src/test/java | Test sources |
src/test/resources | Test resources |
src/test/resources-filtered | Test resources which are filtered by default. (Starting with Maven 3.4.0, not yet released.) |
src/test/filters | Test resource filter files |
src/it | Integration Tests (primarily for plugins) |
src/assembly | Assembly descriptors |
src/site | Site |
LICENSE.txt | Project's license |
NOTICE.txt | Notices and attributions required by libraries that the project depends on |
README.txt | Project's readme |
细节请参考 https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
除了官方标准的目录外,如果我们有一些其他文件要放,应该放到什么目录下面呢?比如 SQL、Shell 脚本?
对于这个问题,Maven 并没有制定标准,我们自己可以按照如下约定放置:
目录 | 说明 |
---|---|
src/scripts | 启动脚本 |
src/main/scripts | 程序中调用的脚本 |
src/main/db | 数据库相关脚本,比如建表 SQL |
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于