vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Building a project never finishes

Open tsaarni opened this issue 2 months ago • 10 comments

Background:

I'm working on Keycloak using vscode-java. This project has proven to be quite challenging before, and unfortunately I now again have new problems that I'd kindly ask for help to troubleshoot.

The problem:

When opening the project the Java build never finishes. The constant re-compilation on the background will consume considerable CPU resources and heat up the machine.

The project builds correctly from command line using mvn.

Environment
  • Operating System: Ubuntu 23.10
  • JDK version: openjdk 17.0.10
  • Visual Studio Code version: 1.89.0
  • Java extension version: v1.30.0
Steps To Reproduce
  1. git clone https://github.com/keycloak/keycloak.git
  2. cd keycloak
  3. mvn clean install -DskipTestsuite -DskipExamples -DskipTests
  4. open vscode
  5. observe jdt starting to build the project but getting into infinite loop
Current Result

The loop that gets executed again and again consists of following sequence of maven modules (grepping from logs):

  message: '[Info  - 2:28:33 PM] May 3, 2024, 2:28:32 PM Built project keycloak-parent in 3798 ms',
  message: '[Info  - 2:28:34 PM] May 3, 2024, 2:28:34 PM Built project keycloak-admin-ui in 1665 ms',
  message: '[Info  - 2:28:34 PM] May 3, 2024, 2:28:34 PM Built project keycloak-distribution-licenses-common in 4 ms',
  message: '[Info  - 2:28:34 PM] May 3, 2024, 2:28:34 PM Built project keycloak-distribution-parent in 1 ms',
  message: '[Info  - 2:28:34 PM] May 3, 2024, 2:28:34 PM Built project keycloak-js-adapter in 3 ms',
  message: '[Info  - 2:28:34 PM] May 3, 2024, 2:28:34 PM Built project keycloak-js-admin-client in 48 ms',
  message: '[Info  - 2:28:35 PM] May 3, 2024, 2:28:35 PM Built project keycloak-js-parent in 479 ms',
  message: '[Info  - 2:28:36 PM] May 3, 2024, 2:28:36 PM Built project keycloak-account-ui in 1605 ms',
  message: '[Info  - 2:28:36 PM] May 3, 2024, 2:28:36 PM Built project keycloak-distribution-licenses-common in 5 ms',
  message: '[Info  - 2:28:36 PM] May 3, 2024, 2:28:36 PM Built project keycloak-distribution-parent in 1 ms',
  message: '[Info  - 2:28:36 PM] May 3, 2024, 2:28:36 PM Built project keycloak-js-parent in 1 ms',
  message: '[Info  - 2:28:40 PM] May 3, 2024, 2:28:40 PM Built project keycloak-parent in 3745 ms',
  message: '[Info  - 2:28:42 PM] May 3, 2024, 2:28:42 PM Built project keycloak-admin-ui in 1718 ms',
  message: '[Info  - 2:28:42 PM] May 3, 2024, 2:28:42 PM Built project keycloak-distribution-licenses-common in 6 ms',
  message: '[Info  - 2:28:42 PM] May 3, 2024, 2:28:42 PM Built project keycloak-distribution-parent in 1 ms',
  message: '[Info  - 2:28:42 PM] May 3, 2024, 2:28:42 PM Built project keycloak-js-adapter in 5 ms',
  message: '[Info  - 2:28:42 PM] May 3, 2024, 2:28:42 PM Built project keycloak-js-admin-client in 49 ms',
  message: '[Info  - 2:28:42 PM] May 3, 2024, 2:28:42 PM Built project keycloak-js-parent in 486 ms',
  message: '[Info  - 2:28:44 PM] May 3, 2024, 2:28:44 PM Built project keycloak-account-ui in 1663 ms',
  message: '[Info  - 2:28:44 PM] May 3, 2024, 2:28:44 PM Built project keycloak-distribution-licenses-common in 5 ms',
  message: '[Info  - 2:28:44 PM] May 3, 2024, 2:28:44 PM Built project keycloak-distribution-parent in 0 ms',
  message: '[Info  - 2:28:44 PM] May 3, 2024, 2:28:44 PM Built project keycloak-js-parent in 1 ms',

it will then start from the keycloak-parent again, and continue forever, trying to build this set of modules. I'm not able to identify the reason why the build is (re)triggered again and again.

Here are some log files from build:

Expected Result

Build should finish.

Additional Informations

I'm enabled following logs in .vscode/settings.json

  "java.jdt.ls.vmargs": "-Dlog.level=ALL -Djdt.ls.debug=true -Dmaven.plugin.validation=verbose -Xmx16G -Xms100m",
  "java.trace.server": "verbose",

I've also tried excluding submodules by adding following in .vscode/settings.json but build still gets stuck in the same way, even though in theory the looping modules should not even be imported anymore

  "java.import.exclusions": [
        "**/node_modules/**",
        "**/node/**",
        "**/js/**",
        "**/distribution/**",
        "**/themes/**"
  ]

Some time ago I could open the project without infinite build loop. I did not use exclusions or any other workarounds in settings. At the moment, I do not yet know if my problem appeared after changes in Keycloak code or possibly after vscode-java update, or something else.

tsaarni avatar May 03 '24 12:05 tsaarni