IDE name and version : Eclipse IDE for Java Developers 2024-12 (4.34.0)
SonarQube for Eclipse plugin version: 11.1.0.82589
Programming language you’re coding in: Java
Is connected mode used: true
SonarQube Cloud
Hi,
I made my first step with sonarcloud + eclipse IDE plugin.
I try to add it to a Maven Multi-Module Java Project. This is an open source project hosted at eclipse foundation. (GitHub - eclipse-leshan/leshan: Java Library for LWM2M)
Currently, I just add sonarcloud in automatic mode. (I’m still not sure if I must move to CI-integrated way instead) and I wanted to try how it behave in the IDE and so I bind each of maven module(so each an eclipse java project) to my sonarcloud project.
Until now, users experience is not so great, I faced some errors (lot of popup error dialog) not always reproducible…
One always reproducible issue is when I try to Open in IDE from sonarcloud, I get a popup with file not found error dialog (nothing in error log), It seems it search file in bad eclipse project
So I wanted to know if this setup (maven multi-module, eclipse, sonarcloud) is supposed to work ?
I try to open an issue in DefaultRegistrationEngine.java from leshan-lwm2m-client maven module and here the logs :
Assist connection and binding if needed for project eclipse-leshan_leshan and server https://sonarcloud.io
Elect best matching branch for project 'leshan-tl-javacoap-client-coaptcp' among: master
Best matching branch is: master
GET 200 https://sonarcloud.io/api/issues/search.protobuf?issues=AZUkcOhjTrqI41_W-G_r&componentKeys=eclipse-leshan_leshan&ps=1&p=1&branch=master | response time=101ms
GET 200 https://sonarcloud.io/api/sources/raw?key=eclipse-leshan_leshan%3Aleshan-lwm2m-client%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fleshan%2Fclient%2Fengine%2FDefaultRegistrationEngine.java&branch=master | response time=107ms
I’m not sure why it searches on leshan-tl-javacoap-client-coaptcp project only
I have several eclipse project binding to only 1 sonarcloud project.
1 eclipse project for root of our code repository.
1 eclipse project for each maven child module.
and thanks for reaching out. We are aware of issues when using the Open in IDE feature with hierarchical projects (like Maven) and have a ticket for that.
This is coming from a limitation from the shared library among all SonarQube for IDE flavors and will be hopefully tackled there soon and afterward in the Eclipse plug-in itself. Eclipse is the only IDE that is taking different modules as separate projects and therefore we rely on the sparse exposed logic by m2e. This needs to be improved, I agree with you, but it is a complex refactoring.
For now, I would advice you to manually bind them: As I see you already have set up the connection, then afterward for every Eclipse projects (corresponding to one Maven module in that project) just bind it to the same project on SonarQube Cloud. We do the exact same for our plug-in - it consists of multiple modules and is bound to one specific SonarQube Server project.
Regarding the errors and their notifications you faced, please provide us with the logs for them as requested in the notification to see what is going on and what needs to be improved.
Open in IDE does not work correctly on hierarchical projects like Maven/Gradle that also have multiple modules/sub-projects bound to the same SonarQube Server / Cloud project.
So in general, you’re welcome and feel free to reach out at any time if you encounter any other issues!
Creating websocket connection to wss://events-api.sonarcloud.io/
WebSocket opened
sent 'subscribe' for project 'eclipse-leshan_leshan'
sent 'subscribe' for project 'eclipse-leshan_leshan'
Server event received: {"action":"subscribe","events":["MyNewIssues"],"status":"success"}
Server event received: {"action":"subscribe","events":["IssueChanged","QualityGateChanged","SecurityHotspotChanged","SecurityHotspotClosed","SecurityHotspotRaised","TaintVulnerabilityClosed","TaintVulnerabilityRaised"],"status":"success"}
Error occurred on the WebSocket
java.io.IOException: Connexion terminée par expiration du délai d'attente
at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:47)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:341)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:295)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:270)
at java.base/sun.nio.ch.SocketChannelImpl.implRead(SocketChannelImpl.java:426)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:493)
at java.net.http/jdk.internal.net.http.SocketTube.readAvailable(SocketTube.java:1178)
at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:841)
at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:207)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:280)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:233)
at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:782)
at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:965)
at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253)
at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:1478)
at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:1423)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:1423)
Closing SonarCloud WebSocket connection, reason=WebSocket was closed by server or reached EOL...
Creating websocket connection to wss://events-api.sonarcloud.io/
WebSocket opened
sent 'subscribe' for project 'eclipse-leshan_leshan'
sent 'subscribe' for project 'eclipse-leshan_leshan'
I suspect this is when connection is lost. (e.g. when my computer go to sleep)
So this sounds ok that connection is lost and a new one is recreated but maybe it should be done silently ? no need to annoy user with an error popup which makes think that something wrong happen ?