如何组织Java程序的源文件?

时间:2012-08-12 22:25:10

标签: java resources jar exe project-organization

我在Java创建了一个小程序。它使用Java类,一些图像并生成一些其他资源(.php文件,图像,样式表等)。

我正在将来源编译为.jar并创建一个.exe程序,该程序应该使用我的.jar和其他资源。

组织Java程序的所有源代码的最佳实践是什么?

1 个答案:

答案 0 :(得分:6)

即使您没有使用maven,我也会推荐以下maven结构作为standard convention

src/main/java   Application/Library sources
src/main/resources  Application/Library resources
src/main/filters    Resource filter files
src/main/assembly   Assembly descriptors
src/main/config Configuration files
src/main/scripts    Application/Library scripts
src/main/webapp Web application sources
src/test/java   Test sources
src/test/resources  Test resources
src/test/filters    Test resource filter files
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
相关问题