How to integrate custom Apex rules (PMD)

Hello,

could you help me with answer to this question from sonar perspective? what will be the ideal solution for this? adding custom pmd rules in sonarlint and having it directly consumed by sonar sever in connected mode? (is this achievable? if yes can u share the steps) or having the report file generated and make the sonarqube consume the report file using extra properties in pipeline task?

Link to question: https://stackoverflow.com/questions/63296285/custom-pmd-rules-query