Issue
I have been assigned to a project that builds some Eclipse plugins. There is a root pom.xml
, and maven builds it successfully. But when I load it into VSCode, with the Java Pack (vscjava.vscode-java-pack
) loaded, and load the Java projects, many files produce errors like
The declared package "com.correct.package" does not match the expected package ""
and
The import com.something cannot be resolved
even though maven just built the packages just fine.
Now the obvious reason why it might not work is that the tycho-pomless extension is installed and most of the sub-packages only have .project
, build.properties
and plugin.xml
, but no pom.xml
.
Is it possible to generate all the pom.xml
s or something else that the VSCode plugin would understand to set the correct package roots and classpaths?
Solution
Right click the folder which contains the folder com
and choose Add Folder to Java Source Path. Try this and see if the question goes away.
Answered By - Molly Wang-MSFT
Answer Checked By - Katrina (JavaFixing Volunteer)