exasol / error-code-crawler-maven-plugin

Validator and crawler for exasol-error-codes in Java code
MIT License
1 stars 1 forks source link

Wrong src url when used with lombok #71

Closed jakobbraun closed 2 years ago

jakobbraun commented 2 years ago

When used with projects that use Lombok, we run this tool on the delomboked sources. So on target/delombok/main/ instread of src/main/java. That's required because this plugin could not parse the sourecode with Lombok annotations (Spoon woul throw compile errors).

A problem with that is, that the crawler writes the wrong URLs into the report. For example:

{
      "identifier": "E-PK-SMC-37",
      "message": "Could not get checked out branch of repository.",
      "sourceFile": "target/delombok/main/com/exasol/projectkeeper/shared/repository/GitRepository.java",
      "sourceLine": 53,
    },

A simple solution would be to replace the prefix in the filename. However, this does not fit, since the line-numbers are different in the delomboked files, since the Lombok annotations are unfolded to Java code.

Another idea is to change the crawler to run on the compiled byte code instead of the source code.

jakobbraun commented 2 years ago

Another option would be simply not to crawl the source location in that case. Currently, we anyway don't display it in the catalog.

redcatbear commented 2 years ago

Don't craw in this case.