microsoft / vscode-maven

VSCode extension "Maven for Java"
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven
Other
181 stars 88 forks source link

Resolving import with generated files #967

Closed PaulBazin closed 1 year ago

PaulBazin commented 1 year ago

Describe the bug I have this use case where I generate java files with swagger in a mutli modules maven project. When importing such generated class in another project, even tho mvn clean install works, VS Code is showing up a The import cannot be resolve error.

To Reproduce Steps to reproduce the behavior:

  1. Unzip the sample project Tmp.zip
  2. Open the folder in VS Code
  3. See the error in demo project src/main/java/com/example/frameOne.java

Expected behavior Import is resolved.

Environments (please complete the following information as much as possible):

jdneo commented 1 year ago

Add this line <?m2e execute onConfiguration?> can solve your problem.

image

PaulBazin commented 1 year ago

Thank you so much for your answer. To understand why this solve the problem : vsCode-maven is based on some m2e librairies ? Again thank you !

jdneo commented 1 year ago

VS Code Maven is not based on m2e, This extension is used to provide some handy features to run maven commands in VS Code.

It's redhat.java importing the project, and provide language related features.