There are so many sub-projects in the JIRA source code, is there some documents to explain what's purpose of every sub-project?
And how to debug the JIRA source code in local machine?
There isn't a document that explains each of the subfolders, etc in the JIRA Source Code but that would be beneficial. You can help get that created by going to https://jira.atlassian.com/secure/Dashboard.jspa and creating a feature request to have the developers publish and article such as the one you're seeking.
In regards to debugging JIRA, there are two articles that may help you:
Creating a Remote Debug Target
Hey team! I'm Cameron Deatsch, Head of Server at Atlassian. I'll be hosting an AMA over in our Questions section of the Community next Monday, so shoot me your questions, upvote others' question...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs