Skip to content

not finding generated packages although they are working when using mvn cli #1552

Closed as not planned

Description

Type: Bug

I am having multi-module maven project where module B uses code generated during the build of module A using open-api generator. I have checked the jars, and the classes are actually correctly included. I have built and deployed the app, and all is working fine. Except for VSCode, which is always giving an error that the generated pacakge does not exist, although it was used in the code using autocompletion. So, autocomplete knows the pacakge is there, but not the syntax checker?

Extension version: 0.30.5
VS Code version: Code 1.108.2 (c9d77990917f3102ada88be140d28b038d1dd7c7, 2026-01-21T13:52:09.270Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs Intel Xeon Processor (Skylake, IBRS, no TSX) (4 x 2494)
GPU Status 2d_canvas: unavailable_software
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: disabled_software
video_encode: disabled_software
webgl: unavailable_software
webgl2: unavailable_software
webgpu: unavailable_software
webnn: unavailable_software
Load (avg) undefined
Memory (System) 23.92GB (12.27GB free)
Process Argv --crash-reporter-id f04d5f99-969d-47ae-b08d-48fd88216d77
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31436602
aj953862:31281341
6abeh943:31336334
cloudbuttont:31379625
aihoversummaries_f:31442085
3efgi100_wstrepl:31403338
use-responses-api:31390855
ddidtcf:31399634
je187915:31401257
ec5jj548:31422691
cmp-ext-treat:31426748
cp_cls_t_966_ss:31446430
a9239246:31445437
c0683394:31419495
ge8j1254_inline_auto_hint_haiku:31431912
nes-autoexp-10:31446583
a5gib710:31434435
5j92g670_sonnet:31446810
rename_enabled:31436409
7a04d226_do_not_restore_last_panel_session:31438103
anthropic_thinking_t:31432745
h0hdh950:31428394
cp_cls_c_1081:31443829
copilot-nes-oct-trt:31432596
ia-use-proxy-models-svc:31452481
nes-jump-on-with-edit:31450417
nes-slash-models-on:31441832
nes-set-to-on:31441941
a43f0574:31442827
ts_provider_disabled:31446105
c0ci8992_validated:31449878
nes-conv-1-2:31447851

Activity

  1. github-actions commented on Jan 27, 2026

    @github-actions

    Hi Ahmad Hamdan (@hamdan-ahmad-lb), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    Solution

    • Make sure your OpenAPI Generator runs in the generate-sources phase and writes into target/generated-sources:

      <plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <version>YOUR_VERSION</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <output>${project.build.directory}/generated-sources/openapi</output>
              <!-- other config -->
            </configuration>
          </execution>
        </executions>
      </plugin>
    • Add the generated-sources directory to your Maven project so VS Code’s Java extension picks it up. For example, in module A’s pom.xml:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>add-generated-sources</id>
            <phase>generate-sources</phase>
            <goals><goal>add-source</goal></goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/openapi</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      Ref: “Generated classes not added to classpath” issue → Generated classes not added to classpath redhat-developer/vscode-java#1725

    • After a full Maven build, refresh the workspace so the language server re-indexes:

      • Run Maven: Update Project (via Command Palette)
      • Then Java: Clean the Java language server workspace and reload the window

    Labels

    • bug
    Other references with low confidence

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

  2. github-actions commented on Feb 20, 2026

    @github-actions

    This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions