What is the best practice for setting up package structures in a Java web application?
How would you install the src code, unit test, etc.?
You can follow the maven project standard. You do not need to actually use maven, but it will facilitate the transition in the future (if necessary). In addition, other developers will use this layout, since many open source projects are laid out in such a way
There are several existing resources you can check:
For what it's worth, my own personal recommendations that I usually use are as follows:
A few other points:
I would suggest creating the structure of your package by function, not by implementation level. Good entry on this Java practice: package by function, not layer
Here you can read about standard directory layouts and the directory / package structure for a java project.
I usually like the following:
This can be considered unconventional, but I believe that this is a very good way to organize things.
Another very good article about Java package structure: Java classpath management
As usual, I have a folder hierarchy -