Debug opendistro plugin using intellij

Hi

I am making some changes in the code. How can I debug the code in intellij and connect to a remote server where elasticsearch is running with the plugin installed.