This repository is the follow-along sample for the blueprint "Sonar Vortex semantic navigation for developers and coding agents". The blueprint is the primary learning resource. It explains each step and shows the expected output of every command. This repository gives you the code to run them against.
The code is a fork of Microsoft's GCToolKit, a Java library that parses HotSpot garbage collection logs: a multi-module Maven project with 312 Java source files. It is large enough that tracing callers and implementations with text search gets tedious, which makes it a good target for semantic navigation. The upstream README is kept as README-gctoolkit.md, and the upstream MIT license and notices are unchanged.
mainis the exact code the blueprint analyzes. Every*.javafile is identical to the upstream snapshot used in the blueprint run, so the navigation output you get matches the blueprint..github/workflows/build.ymlis a "Build and Analyze" GitHub Actions workflow. It builds with the Maven wrapper (JDK 21) and runs the SonarQube Cloud scanner. It needs one repository secret,SONAR_TOKEN.- The root
pom.xmlsets no SonarQube organization or project key. The workflow passes both on the command line. - There is no
.sonar-config.json. You create it withsonar linkin the blueprint.
The project has no dependencies beyond what upstream GCToolKit already uses. Nothing was added for this sample.
- Select Use this template to create your own copy (the repository is a template). The workflow derives the SonarQube Cloud organization from your GitHub owner and the project key from
<owner>_<repository name>, which is the default key SonarQube Cloud assigns when you import a GitHub repository. - In SonarQube Cloud, import your new repository as a project. If your SonarQube Cloud organization key differs from your GitHub owner, or you chose a different project key, edit the two
-Dsonar.*lines in.github/workflows/build.ymlto match. - Add a repository secret named
SONAR_TOKENwith a SonarQube Cloud user token. - Run the Build and Analyze workflow (it also runs on every push to
main). Wait for it to finish so the project has an analysis onmain. - Clone your copy and follow the blueprint. Link the clone to your project with
sonar link(it writes.sonar-config.json), then run thesonar context navigationcommands the blueprint walks through.
./mvnw -B -DskipTests packageThe build needs JDK 21 or later and network access to Maven Central and GitHub, because the gclogs module downloads the upstream test data.
Upstream GCToolKit is released under the MIT license. See LICENSE and NOTICES.md.