How SonarQube SCA derives license information?

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
    • Enterprise Edition v2026.3.1 (123439)
  • how is SonarQube deployed: zip, Docker, Helm
    • Zip
  • what are you trying to achieve
    • Would like to know how SonarQube Derives license refer example below.
  • what have you tried so far to achieve this
    • Analyzed Dependency license information on maven and their transitive dependencies

For this dependency org.codehaus.plexus:plexus-utils: 4.0.3 only apache license is shown on maven central https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-utils/4.0.3

SonarQube License Expression is BSD-3-Clause AND (Apache-2.0 AND (Apache-1.1 AND xpp))

I would like to understand why XPP and BSD-3 license is populated in SonarQube? I want to apply License Profile to application.

Hey @Anant_Kurapati,

SonarQube’s SCA doesn’t use only the license declared in the POM. It builds a license expression from several sources (package manager metadata, the source repo, and our own research) and includes licenses for any bundled components inside the JAR, not just the “main” project license. That’s why you see BSD-3, Apache-1.1 and an xpp license in addition to Apache-2.0 for plexus-utils – SCA has identified additional code in that artifact that is under those licenses as well.

In your license profile, an AND expression means all listed licenses must be allowed for this dependency not to raise a license risk.

@andres Thanks for taking time to respond .

Few more questions ahead ,

  1. Rocksdb maven dependency, which is dual licensed , repository it self has declaration

GitHub - facebook/rocksdb: A library that provides an embeddable, persistent key-value store for fast storage. · GitHub

“RocksDB is dual-licensed under both the GPLv2 (found in the COPYING file in the root directory) and Apache 2.0 License (found in the LICENSE.Apache file in the root directory). You may select, at your option, one of the above-listed licenses.”

Github autodect thinks rocksdb is licensed under GPLv2 · Issue #3417 · facebook/rocksdb

SonarQube is giving Apache 2.0 AND GPLv2

Expectation: Apache 2.0 OR GPLv2

Lets for this example if we choose License Apache 2.0 will generated SBOM have both?

How do we tell customer through SBOM we are complying with Apache 2.0 for this dependency?

  1. GPL Licensing references cannot be found in artifacts shipped lxml-4.9.3 python dependency

No actual artifact present, only a mention in the licenses.txt file that this dependency has some test.py file which is GPL licensed, however this file is present on repository of package but not actually shipped in the runtime installable artifact.

Ref: GitHub - lxml/lxml: The lxml XML toolkit for Python · GitHub

  1. Feature : Can SonarQube help us detect from where license is generated, this will definitely help end users to take decision ?

Hey @Anant_Kurapati, I’m going to flag this for the team, since your questions are getting more specific and you’re also bringing up a new feature. I prefer to have someone more specialized look into this.

@andres Thanks for taking this up, I wanted to understand SonarQube working on License Assignment , my specific question were based on that.