为什么Eclipse / Maven(m2e)在异常后没有找到库的源代码?

时间:2016-09-18 10:36:26

标签: eclipse maven m2e

当库文件中抛出异常时,我的Eclipse无法找到源代码。见图。但是,当我在我的代码中执行F3(转到定义)时,Eclipse会将我带到库源代码。

Exception, no source

但是来源存在。在我的用户目录中是public class ReadmanifestFile { public String getManifestAttributes() throws IOException { String value = null; File file = new File("G:/AD/JAR_FILES/mail.jar"); if (file.isFile()) { JarFile jarfile = new JarFile(file); Manifest manifest = jarfile.getManifest(); Attributes attributes = manifest.getMainAttributes(); value = attributes.getValue("Export-Package"); String[] arr = value.split(";"); for (int i = 0; i < arr.length; i++) { System.out.println(arr[i]); } } return value; } ,其内部是.m2\repository\com\google\cloud\dataflow\google-cloud-dataflow-java-sdk-all\1.7.0\google-cloud-dataflow-java-sdk-all-1.7.0-sources.jar

当我单击Edit Source Lookup Path时,我注意到列出了本地com\google\cloud\dataflow\sdk\options\PipelineOptions.java存储库中的许多源jar,但不是这个。见图。

所以,我手动添加source-jar并重新运行。见最后一张图片。但Eclipse仍无法找到源代码。

如何让Eclipse找到源代码?

我正在使用Eclipse 4.5.1和m2e 1.6.2。

source paths

added manually

0 个答案:

没有答案