Sonar Eclipse issue - eclipse

I am having some issues running Sonar analysis in Eclipse. I have Java Maven project with Groovy Spock unit tests.
mvn sonar:sonar
Works fine and generates reports which I can see on the "localhost:9000".
However I need to see issues in Eclipse. I have done the Configure->Associate... and now when I choose "SonarQube->Analyze" I get following errors in the console:
10:18:23.892 ERROR - Invalid value of sonar.libraries for com.otpp.email:bulkemail-downloader
Exception in thread "main" org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41)
at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59)
Caused by: java.lang.IllegalStateException: No files nor directories matching 'C:\Program Files\springsource\ggts-3.4.0.RELEASE\plugins\org.codehaus.groovy_2.0.7.xx-20130828-1400-e43-RELEASE\plugin_dsld_support\' in directory C:\Users\SHEVELD\workspace\bulkEmailDownloader
at org.sonar.batch.scan.DefaultProjectBootstrapper.validateDirectories(DefaultProjectBootstrapper.java:343)
and Eclipse also shows error pop-up with following details:
Error during execution of Sonar
Error status [command: C:\Program Files\Java\jdk1.7.0_45\jre\bin\java.exe -Dsonar.exclusions=file:**/fixtures/** -Dsonar.buildbreaker.skip=true -cp C:\Users\SHEVELD\AppData\Local\Temp\sonar-runner-impl8294792314646586115.jar org.sonar.runner.impl.BatchLauncherMain C:\Users\SHEVELD\AppData\Local\Temp\sonar-project5418432264915204295.properties]: 1
From all this codes I understand that there is some issue with sonar-eclipse-groovy triangle.
Any hint is greatly appreciated!
Edit _________________
I reinstalled the GGTS into a non-shared folder (aka "C:\tools" and not "C:\Program Files"). Sonar plugin ran an analysis using my local server. However it stopped working upon switching to a remote server.
Actually it worked with a local Sonar server for a bit. Now, when I switched to a remote Sonar server it again gives me the same error.
Additionally I tried Installing Groovy plugin on the regular Kepler Eclipse and after doing that Sonar stopped working...

Removing Groovy DSL jar from the classpath solves the problem, but is pretty useless solution.
They created ticket for this issue:
https://jira.codehaus.org/browse/SONARIDE-430
after my question:
How can I file an issue for SonarQube Eclipse plugin

I would like to post this as a comment, but as mys reputation is lower 50 i can't do so...
1.) Checkthe following: In Eclipse go to "window --> preferences" and take a look if an entry for "SonarQube" exists or not.
1b.) If not go "Help --> Eclipse Marktplace" and search for SonarQube and install the plugin. Restart Eclipse now. Follow the instuctions in 1.)
2.) Click on SonarQube entry and then choose the Servers entry
3.) As default a Server is registered here already, but you can delete him. Click on "add" on the right side and fill in your data. Click "Test Connection" to make sure your settings are correct.
EDIT: Checked it on my own projects: I getting a "Unable to contact SonarQube server". Try to run the project as maven build within eclipse and use "sonar:sonar" as command. (Have you installed the Maven-Plugin in Eclipse?)

Related

Eclipse Spring Boot Build Path Contains Duplicate Entry

I have been using Eclipse Luna and sprint boot for quite a while. Just today, when I created a new project I am getting the following build error,
Build path contains duplicate entry: 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' for project 'TomcatHttpDemo'
I am not sure if this is related to this problem but I tried
properties> Java Build Path > Libraries
and found that 'JRE System Library[JavaSE-1.8] was listed twice. I deleted one of them and then cleaned and re-built the project. I got a bunch of new errors. These errors were all related to deleting the JRE system library. I even restarted Eclipse several times to clear out any lingering errors.
I was running Luna 4.4 and upgraded to Mars 4.5 but the problem continues to persist. I can build my old projects with no problems at all. Using Luna or Mars the old projects build and execute properly. Any time I try to create a new project I get the duplicate entry error. Any help would be appreciated.
if i understand your problem it's library issue with your project so
1.Select your project then go to Properties
2.Java build Path
3.in the Top select Libraires
4.add a JRE System Library
5.check the Execution Environment Then Click to Environments
6.On the left click to Installed JREs
7.Then Click To add , Standard VM
8.click To directory Then go to /yourprograms/java/jdk 1.8
9.then Click finish after this check what you just added and click ok
10.when everything is closed update your maven Project
i hope it helps you

plug-in org.eclipse.m2e.core.ui was unable to load class

I had made an maven project and it worked fine.
Then I installed plugins
EclEmma Java Code Coverage,
PHP Development Tools (PDT),
Eclipse.orgSonarQube
Then I worked on some other project. When I again wanted to create an maven project,it threw the following error window which said
The selected wizard could not be started
reason
plug-in org.eclipse.m2e.core.ui was unable to load class
org.eclipse.m2e.core.ui.internal wizards.MavenProjectWizard
Removed SonarQube plugin .This solved the issue.
Now it works all fine.
But is there any other solution to this problem since I have to use sonar.
Click on eclipse help tab and open installation details search sonar and remove all related plugins.
That's not quite the right characterization of what it says on the page,Please check your .log file /path/workspace/.metadata/
Find the correct plugin which is causing this problem and update to compatible version of the plugin with eclipse version.
To find the hidden files in the workspace use Ctrl+H
I had the same problem, and I've tried so many solutions. But what I did to solve the problem, is that I just upgraded my Eclipse IDE (2019-06 to 2020-03) by following these steps (from https://wiki.eclipse.org/FAQ_How_do_I_upgrade_Eclipse_IDE%3F) :
You first need to add the new release's repository as follows:
1-1. Window > Preferences > Install/Update > Available Software Sites
1-2. Click 'Add'
1-3. Enter the URL https://download.eclipse.org/releases/2020-03/
1-4. Click 'Ok'
Help > Check for Updates
If updates are found, proceed through the install wizard and restart the IDE when
prompted. Otherwise, read carefully the error message to find out which component
is conflicting and establish your resolution strategy.
Note that the start splash screen may be cached and will not necessarily be
updated to the latest version after the IDE is restarted. Performing a full
relaunch should display the new version number.

Node.js & Eclipse integration

I have installed updates of nodeclipse,but i am not able to run my java script file even though when i run them in node folder.
i get these errors like:
1)provisioning exception
2)No repository found
Correct name is nodeclipse
As said in http://www.nodeclipse.org/#support you should
I got this error and I'm sure it's a bug -- raise an issue!
Should you report a bug, please include the following:
Nodeclipse version number (like 0.4 or 0.8)
Eclipse version number (like 4.3.1 Kepler or 4.4.0)
Eclipse distribution (e.g. Eclipse for JEE Developers)
A detailed description of the steps necessary to reproduce the problem.
Screenshot and stack trace, that you can get from Eclipse Error Log View (Window -> Show View ...) or from '.log' file from the directory '.metadata' in your workspace.
See example issue #78

Associating a Project to Sonar in Eclipse

I have Eclipse Indigo 3.7 base with MyEclipse 10 Java enterprise development plug-in:
I have installed Sonar plug-in for eclipse.
Installed Sonar server and running it locally from localhost (localhost:9000)
Tested the Server connection in Eclipse from
Windows>Preferences>Sonar>Servers. Connection is successful.
For my Project, ran the Maven goal for sonar (sonar:sonar). Build is
successful. I am able to browse the results in localhost. (localhost:9000)
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"
I click on that field and enter my groupid:artifactid but nothing
happens.
I also tried entering the Project Name listed in Sonar dashboard
but that also does not help.
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.
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:
Install the eclipse plugin, and test server connection
Install the Sonar server and start it (for example on yourhost:9000)
Go to yourhost:9000 and login (admin/admin unless you changed it)
Go to Settings -> System -> Provisioning
Create new project (+Create in the top right corner)
I've used key=Liferay6.2 and name=liferay-plugins-sdk-6.2.0
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.
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)
BEST ANSWER AFTER SO MUCH ANALYSIS(I have faced the same problem)
Forget to add to associate with SonarQube first
If you want to add sonar group id create 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
download sonnar-runner from github.
download sonar example from github
download sonar
run sonar as per your operating system from command prompt
go to sonar example path like c:/sonar example/java/.. /.. *.properties path (beside src)
run sonnar-runner c:/.... / sonnar-runner.bat -e
go to browser http://localhost:9000 after that (login:admin/admin)
your project is displayed in the browser.
Choose Maven on the project and then choose Select Maven Profiles and then choose with-sonar in Eclipse. This will enable the Sonar functionality on projects. Now you will see the Sonar option when you right click on projects.

"Unable to locate JAR/zip" error for JDBC connections [BIRT Eclipse, Windows 7, Oracle 11g]

As an FYI, I'm new to this entire stack, so I might be making a basic error.
I'm attempting to explore BIRT reporting for a Maximo system that was recently upgraded.
To do so, I installed the following:
Java 6 & Java 7 JDKs
BIRT version of Eclipse (Eclipse + BIRT plugins built in).
Some Oracle 11gR2 client options (a custom install)
SQL*Plus
JDBC/ODBC drivers
Thin Client
I take the following steps:
Open Eclipse
Create a new Reporting Project
Add a Data Source
Select "JDBC Data Source" (also tried "JDBC Database Connection for Query Builder")
Select the "Oracle" connection profile type and click next.
At this point, I see that the drivers list is empty. This strikes me as odd, but I figure maybe I have to define the driver definition. So I take the following steps:
Click "Define driver definition"
In the Name/Type tab, select "Oracle Thin Driver", system version 11
At this point, I see an error message: Unable to locate JAR/zip in file system as specified by the driver definition: ojdbc14.jar. It seems that ojdbc14.jar doesn't even exist on my system that I can find.
I have tried adding other jdbc jar files that I can find in the oracle client directory (i.e. from Oracle_Base\product\11.2.0\client_1\jdbc\lib) but nothing seems to resolve the issue.
Help?
I had similar issue.
Clicking "Clear all" and then adding the jar manually solved the problem.
The answer in this case was unfortunately stupidly simple -- after closing and reopening Eclipse, I had no trouble removing the driver, adding another, and getting to work. I was up and running in no time.
Thanks for all your help!
Ensure the ojdbc14.jar file exsists and is in your library path. When on the dialog for picking the driver ojdbc14.jar, simply click the find jar/zip button and find the file.
Sometimes it is there, but still does not work. To solve this problem, press the "clear all" button. Now repeat the above process. The .jar will be added and you will continue to driver connection and details dialog box.
This happens because the Eclipse IDE could not find the driver in the eclipse installation path. This is what you will do:
Search for the .jar file in your system and copy it to the eclipse installation path.
If you could not get it visit http://dev.mysql.com/downloads/connector/j and locate the required connector. Download it and save it to the eclipse installation path. So now Eclipse can see it and the error would no longer appear.
Very simple answer is Into the Jar Console Click on edit jar and Again select jar in your file system. that will locate file in your file system simple