简体   繁体   English

VSCode 在 tycho-pomless 项目中未检测到 java 路径

[英]VSCode not detecting java paths in tycho-pomless projects

I have been assigned to a project that builds some Eclipse plugins.我被分配到一个构建一些 Eclipse 插件的项目。 There is a root pom.xml , and maven builds it successfully.有一个根pom.xml , maven 构建成功。 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但是当我将它加载到 VSCode 中时,加载了 Java 包( vscjava.vscode-java-pack ),并加载了 Java 项目,许多文件都会产生错误,例如

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.即使 maven 刚刚构建的软件包就好了。

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 .现在它可能不起作用的明显原因是安装了tycho-pomless扩展,并且大多数子包只有.projectbuild.propertiesplugin.xml ,但没有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?是否可以生成所有pom.xml或 VSCode 插件可以理解的其他内容以设置正确的 package 根和类路径?

Right click the folder which contains the folder com and choose Add Folder to Java Source Path .右键单击包含文件夹com的文件夹,然后选择Add Folder to Java Source Path Try this and see if the question goes away.试试这个,看看问题是否消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM