How to organize source files of Java program?

我只是一个虾纸丫 提交于 2019-11-29 23:35:47

问题


I've created small program in Java. It uses Java classes, some images and generates some other resources (.php files, images, stylesheets etc).

I'm compiling sources as .jar and creating an .exe program, which should use my .jar and other resources.

What is the best practice to organize all sources of my Java program?


回答1:


I will recommend the below maven structure as the standard convention even if you are not using maven.

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


来源:https://stackoverflow.com/questions/11926334/how-to-organize-source-files-of-java-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!