09:51:01.924 [WARN] [org.sonarqube.gradle.SonarQubeTask] Unresolved imports/types have been
detected during analysis. Enable DEBUG mode to see them.
09:51:01.925 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Unresolved imports/types:
- __ cannot be resolved to a type
- log cannot be resolved
PIECE OF CODE affected:
@Slf4j
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class XXXX {
public void blaBla() {
doSomethingh();
log.debug("here I log something");
}
}
Seems that because of the 2 lombok annotations the gradleScanner got some strange WARN…
There’s already a solution for this? If not can be addressed?
These warnings are raised when our Java parser does not recognize some types and can not find them in bytecode.
Lombok, precisely, has deep impacts on bytecode (the bytecode of the annotated class does not reflect the actual code that we parse), altering the way you write Java code, and confusing our parser. Our parser requires valid compilable java code as input, and this code can not be compiled with javac “as is”.
More precisely, the annotation @__ is actually not defined anywhere, and the log field is only generated in the bytecode thanks to @Slf4j annotation.
In your case, however,there is nothing to worry about these warnings, they are to be expected when using Lombok, and there is not much we/you can do about it. Feel free to ignore them.