Skip to content

Commit

Permalink
Merge pull request #56 from entur/feature/SIK-1236
Browse files Browse the repository at this point in the history
docs: Add new troubleshooting sub-section to README-code-scan.md
  • Loading branch information
LillieEntur authored Nov 22, 2024
2 parents 0227139 + f4e993e commit 618eecc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README-code-scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,19 @@ java {
}
}
...
```
```

### Autobuild fails for Gradle projects with multiple gradle project files.

Autobuild checks the root project file for which JVM version to set based on the version set on the JVM toolchain.
Github also has a page that explains it in more detail: [Autodetection for java](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#autodetection-for-java)

Autodetect will not find the correct version from child project files, if you have a root project file that does not compile JVM code. To fix this, you can trick autobuild with a comment.

The comment needs to be set on first line of the root project file (build.gradle)
```
// Hint for the CodeQL autobuilder: sourceCompatibility = <JVM_VERSION>
...
```
More detail about this fix in the [Github Issues thread](https://github.com/github/codeql-action/issues/1855#issuecomment-2161052577)

0 comments on commit 618eecc

Please sign in to comment.