Java
Configuration - .deepsource.toml
This section covers configuration details specific to the Java analyzer. Please ensure that you have read the general configuration guide first.
The Java analyzer supports Gradle, Maven and Bazel projects. There is no difference in configuration between them, and all types of projects can be initialized through the simple workflow of the DeepSource configuration generator.
name
- Type: String
- Presence: mandatory
- Description: Shortcode of the analyzer.
- Example:
name = "java"
enabled
- Type: Boolean
- Presence: optional
- Description: Toggle whether this analyzer should be run.
- Example:
enabled = true
meta
- Type: Table
- Presence: mandatory
- Description: Additional data used to configure the analyzer.
- Example:
[analyzers.meta]
runtime_version = "8"
runtime_version
- Type: String
- Presence: mandatory
- Description: The Java runtime version to use when running the analyzer. OpenJDK versions 8 to 17 are currently supported.
- Aliases:
java_version - Example:
[analyzers.meta]
runtime_version = "13"
if runtime_version is not specified, or is the wrong Java version, analysis may fail. Specify the Java version you use locally or in CI for best results.
skip_doc_coverage
-
Type: Array
-
Presence: optional
-
Description: Specify which artifacts to skip when calculating documentation coverage.
-
Available Values:
test,class,constructorandnonpublictest- Ignore documentation coverage within testsclass- Ignore class documentation coverageconstructor- Ignore constructor documentation coveragenonpublic- Ignore documentation for declarations that aren'tpublic
-
Default Value:
[ "test" ] -
Example:
skip_doc_coverage = [ "nonpublic", "test" ]
If skip_doc_coverage is set, it will override any default configuration. That is, if this key is set, and you wish to ensure documentation coverage is skipped for elements that are skipped by default (like tests), you must specify those as well as the additional elements you wish to skip.
legacy ()
- Type: Boolean
- Presence: optional
- Description: Use the Java analyzer in legacy mode. This will build your project before analysis and may detect more issues. This comes with a few caveats; analysis may take longer and might time out for large projects.
- Example:
[analyzers.meta]
legacy = true
Sample config
version = 1
[[analyzers]]
name = "java"
enabled = true
[analyzers.meta]
runtime_version = "8"