Regarding issues reported by SonarLint On-The-Fly for one java file, I see a small subset of issues for the java file. As compared to the SQUID issues shown on SonarQube server for the same file.
I am using SonarQube server version 6.3, SonarLint 3.1.0.and Eclipse Neon.3. Sonarlint is connected to the server successfully and the eclipse project is linked to the project on SonarQube server. The project has component projects and this particular file is in an eclipse component project.
This squid:S1258 does not show in Sonarlint although present in the file; however this squid:S2293 shows on both Sonarlint and SonarQube.
Please advise
The Sonarlint plugin apparently does not utilize the project references to other projects in eclipse. Our applications are represented in multiple eclipse projects. The solution that seems to work is simply to associate each eclipse project to the same SonarQube server project.
I had the same problem, in my case these are the versions in use:
Eclipse Mars.2 (4.5.2)
SonarLint for Eclipse 3.2.0.xxxx
SonarQube Server 6.1
Linux RedHat 64 bit OS
Make sure your Eclipse project is bound to the remote SonaQube server project: sometimes the binding is lost or simply the auto bind feature fails with no warning.
Right click your Eclipse project -> SonarLint -> Bind to a SonarQube project
On the window that pops up verify the SonarQube server is selected, click on
Auto bind selected projects
check that remote bound project is correct and then click Finish.
You can repeat the procedure to verify the binding is still there.
You can apply the procedure to multiple projects at once, just select them before right-clicking.
Related
I am working on Eclipse plugin. At the beginning exporting of it worked fine but I guess that after updating Eclipse it broke down. Eclipse started to mentioned that I have uninstalled some equinox packages. It took time till I understood that version of Eclipse made a problems and I reinstalled older version of Eclipse. Now I am again able to run sample environment with plugin but I still am not able to export plugin. In export form where I need to select deployable plugin and/or fragments I don't have listed anything. From what I found I understand that it might be problem with importing project in Eclipse as it might not remove information that project is external and thus not listing as project that could be exported. But I did not find any way to prove this case.
Is there anybody having any idea how to solve this kind of issue?
I'm checking whether we'd be able to migrate from Ant to Gradle, but got confused right at the very beginning of these checks - Apache Netbeans 12 LTS (+ Gradle plugin from official repo) refuses to properly open Gradle projects that were created by a another Netbeans instance, which is a major pain.
I tried to open (in Netbeans) one of the Java library project examples from Gradle docs, only to find out the IDE immediately spews out errors (missing imports for tests) that are unjustified and offers a very limited amount of IDE integration - forget running specific tests, even debugging is all grayed out. Gradle and Netbeans also see different classpaths.
If I create a Gradle project inside Netbeans, everything works fine - no errors, Projects Tree shows an additional tree node, called "Configurations", like in the image below, I'm able to debug and everything just works.
However, even if I just copy/paste this project's directory to a different location, everything breaks after the project is reopened (I also get this issue, same thing happens for example projects found in Gradle docs).
What is going on here? Netbeans seems to know more about a project it created, than about projects that were created outside it or were just relocated. How do I force it to treat all Gradle projects equally (so that they work as expected)?
I used Gradle 7.0.1 and let the New Projects wizard "Initialize the Gradle wrapper" for the project created inside Netbeans 12 LTS. The setting to prefer existing wrappers is enabled in settings if relevant.
Enabling an "experimental" option in Gradle options, called Enable 'lazy' Source Group Initialization does help with simple projects that were created by Netbeans, so they open as expected.
But this does not work for Gradle projects that contain subprojects, such as the example project from Gradle docs:
The issue tracker for this Netbeans plugin has been quite active recently, mentioning issues like this, so perhaps there is hope.
At least part of the problem is that the LTS release of Netbeans (at the time of this writing) doesn't support gradle 7. The latest release, Netbeans 12.4, is the first version that supports gradle 7.
I have installed some JAVA plugin to the Eclipse. This plugin does not provides the source files (as this plugin contains only a set of JAR files). So, right now I want to "reverse engineering", to debug this plugin (to understand how it does work).
I know that I can run the Eclipse (which includes this plugin) in a "server" mode and then it will wait the remote 'GDB' connection.
Also, I have heard that I can use the Intellij IDEA as an IDE to remote debugging, to debug that Eclipse (with its plugin). But a main issue is that I have not a sources of that Eclipse plugin and I can't open it in Intellij IDEA.
So, my question is: is it possible to debug the eclipse JAVA plugin which has not a sources? And, if yes, then, how I can do it?
BR,
Denis
Using Intellij IDEA for this is nonsense--this is little different from debugging a plug-in when you do have the sources available, and plug-in developers have to do that all the time.
1) Install the Plug-in Development Environment. It's found in the Eclipse Project update site you should already have built-in.
2) Import the plug-in into a project in your workspace. Be sure to look for
3) Launch an Eclipse Application using a different workspace from the Debug menu.
This essentially takes what's in the Target Platform preference page, adds the plug-in from your workspace, and runs a copy of Eclipse with all of that mixed together. It's a different JVM process and should have its own workspace directory.
I am trying to integrate sonarqube with eclipse to analyse simple java project.
But it is not happing. When we right click on simple java project and hit Configure-> Associate SonarQube, the window appear where field appear like Project and SonarQube project.
Project field is autopopulated with the java project you right clicked and What we need to enter in SonarQube project is not clear to me. Also no tab is appearing where we can do something like SonarQube -> Analyse.
(I have added sonaqqube plugin in eclipse and also set sonarqube server path to localhost:9000)
Please suggest.
The SonarQube Eclipse plugin lets you associate (and locally analyze) projects that have already been analyzed by other means (maven target, ant task, SonarQube runner). It is not meant as a way to launch persisted (shared) analyses.
So if you want to use the SonarQube Eclipse integration, please do a first analysis of your project, then try to associate it from Eclipse. This will allow you to synchronize the issues and perform local (preview) analyses.
[EDIT]
On recent (4.x) versions of SonarQube, you also have the option to provision your project on the server. This will allow you to associate your Eclipse project and perform preview analyses.
we recently migrated to Maven Build manager & git hub repository for our Java web-app. Also i switched to eclipse as eclipse has good set of plugins.
As a new bie, i am simply running mvn clean package from terminal at the code root directory. And then moving the compiled code i.e., /target/SNAPSHOT/* to tomcat/webapps/ROOT location.
And then starting Tomcat7 server. The process is time taking especially when i do code changes in Java & configuration .xml files.
I want to do it completely in IDE environment as i did earlier in Netbeans, update code -> build and run in debug mode, -> do code changes and then commit.
Heard of egit & m2e in eclipse for maven & github integration, but not sure how to use it.
Please walk me through the steps required in doing so. I am completely new to eclipse.
--
Thanks
You might want to consider using maven-jetty-plugin http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin for running the webapp. You will not need to copy over stuff to tomcat. After configuring this plugin, you can simply run your application by doing mvn jetty:run
I generally do not like running webapps inside Eclipse. It's a personal prefrence, but it is always nice to have an IDE neutral way of building and running your applications. If you have m2e things should work simply fine. I have seen maven-jetty-plugin having hot pluggability where if you changed your web.xml, jetty would reload your application.
We use Git for version control and Maven for dependency management and build automation. Once your project has successfully imported into Eclipse and recognized as a valid java web project, you don't need either Git or Maven in order to build/run it inside IDE. Just creat a server using you existing tomcat installation, add the project to server, then select Run as > Run on Server.
The Complete Guide:
Creating a server
Adding projects to a server
Starting a server
For more details, check out Testing and publishing on your server.