'How to upload maven dependency tree result to sonar

How do i upload / use sonar qube plugin to show dependency tree like in maven ( wants to see what are the libraries used in sonar dashboard )

i tried with this way

mvn dependency:tree
mvn sonar:sonar -Dsonar.login=<logintoken>

But this does not upload the result to sonar qube



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source