I have Eclipse Indigo 3.7 base with MyEclipse 10 Java enterprise development plug-in:
My issue is with Associating the project to Sonar. When i right click on my project, Configure > Associate with Sonar, I get a screen where nothing happens.
Basically the screen has 2 fields,Project and Sonar Project. The Project field contains the name of my Project and Sonar Project field lists this message - "click here to start searching for a remote Sonar project"
When i right click on my project, In the context menu i am unable to see 'Sonar' option.
Help me associate my project to Sonar in eclipse. Please let me know what i am missing. Thanks in advance.
sonar-project.properties
Just add below code
# Required metadata
sonar.projectKey=javapractice
sonar.projectName=javapractice
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=src
# Language
sonar.language=java
# Encoding of the source files
sonar.sourceEncoding=UTF-8
c:/sonar example/java/.. /.. *.properties
path (beside src)c:/.... / sonnar-runner.bat -e
http://localhost:9000
after that (login:admin
/admin
)Go to your project folder in eclipse workspace from the terminal and run following command:
mvn sonar:sonar
This command will create your sonar project. Try associating the project again. Make sure you enter the name associated with your project from your pom file. (Clear the text field)
I had the same issue with my Liferay project in Eclipse (liferay-plugins-sdk.6.2.0) and here is how I got it working:
yourhost:9000
)yourhost:9000
and login (admin/admin unless you changed it)+Create
in the top right corner)After the above steps I went back to my eclipse project and in Configure > Associate with Sonar
I was able to search/find the liferay project.
When using Sonar Eclipse, you can associate Eclipse projects only to the corresponding Sonar modules (unless you are working on a single-module project, which is pretty rare in fact).
This means that you can't associate the root project (which is logical as by definition, a root project has no sources in Sonar). You have to right-click on all the imported Maven modules, and associate them all in a single run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With