codeql icon indicating copy to clipboard operation
codeql copied to clipboard

CodeQL detected code written in Java but could not process any of it.General issue

Open um3ha4a opened this issue 2 years ago • 5 comments

Description of the issue

[2023-08-28 16:26:19] [build-stdout] [INFO] dzwn-public-api-parent ............................. SUCCESS [  0.354 s]
[2023-08-28 16:26:19] [build-stdout] [INFO] dzwn-public-api-app ................................ SUCCESS [01:13 min]
[2023-08-28 16:26:19] [build-stdout] [INFO] dzwn-public-api .................................... SUCCESS [  0.232 s]
[2023-08-28 16:26:19] [build-stdout] [INFO] ------------------------------------------------------------------------
[2023-08-28 16:26:19] [build-stdout] [INFO] BUILD SUCCESS
[2023-08-28 16:26:19] [build-stdout] [INFO] ------------------------------------------------------------------------
[2023-08-28 16:26:19] [build-stdout] [INFO] Total time:  01:15 min
[2023-08-28 16:26:19] [build-stdout] [INFO] Finished at: 2023-08-28T16:26:19
[2023-08-28 16:26:19] [build-stdout] [INFO] ------------------------------------------------------------------------
Finalizing database at E:\00.running\codeql\databases\dzwn.
CodeQL detected code written in Java but could not process any of it. This can occur if the specified build commands failed to compile or process any code.
 - Confirm that there is some source code for the specified language in the project.
 - For codebases written in Go, JavaScript, TypeScript, and Python, do not specify
   an explicit --command.
 - For other languages, the --command must specify a "clean" build which compiles
   all the source code files without reusing existing build artefacts.

I tried with mvn clean install or clean package, got same error, the project can build successfully without codeql. codeql database create E:\00.running\codeql\databases\dzwn --language="java" --command="mvn clean package -DskipTests -Dfile.encoding=UTF-8 --file pom.xml"

codeql version
CodeQL command-line toolchain release 2.14.0.
Copyright (C) 2019-2023 GitHub, Inc.
Unpacked in: E:\00.running\codeql\codeql-win64_v2.14.0\codeql
   Analysis results depend critically on separately distributed query and
   extractor modules. To list modules that are visible to the toolchain,
   use 'codeql resolve qlpacks' and 'codeql resolve languages'.

um3ha4a avatar Aug 28 '23 08:08 um3ha4a

Does your project use Lombok ? If so, could you try running codeql with the following environment variable set: CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS=true ?

Currently Lombok support is still experimental.

aibaars avatar Aug 28 '23 08:08 aibaars

Yes, you're very smart. my project does use Lombok, but after I set CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS=true, the result still the same, maybe some other unsupport lib exists?

update: It tooks me 2 hours to remove all Lombok related code, now the whole project don't have Lombok, but the error output still the same.

um3ha4a avatar Aug 28 '23 12:08 um3ha4a

i have the same question, are you finish it

wuanbin avatar Nov 16 '23 03:11 wuanbin

i have the same question, are you finish it yep, make sure the code path is pure english then it's all fine.

umeharasang avatar Mar 11 '24 02:03 umeharasang

Hi, I have the same problem. Have you solved it?

bay0max avatar Sep 27 '24 02:09 bay0max