Do every string message needs to be in constant(even the ones present only one time at the code). ? I extracted all of them since some of them may need to be used more than once in future.
I have suspicision about the constants' names. What i mean:
does EMAIL = "email" create ambiguity about holding actual email address string, is EMAIL_TEXT = "email" better naming henceforth
Do constants class need to be in constant package?
Your suspicion is correct. I'd call it EMAIL_PARAM or EMAIL_KEY.
Depends on the domain of the project itself. If the project is about math problems - probably yes, if it's something related to non-science stuff - I'd rather keep them to the package, where they are used, because in this case a package named constant doesn't bring any value to the reader of your code.
https://github.com/nanovche/expense-tracker/blob/62d3f2e5dc3c7f51fe5f968d5518da08cef777ae/expense-tracker-api/src/main/java/com/pairlearning/expensetracker/resources/CategoryController.java#L26