开发者

Can't download sources (NullPointerException)

开发者 https://www.devze.com 2023-04-08 05:05 出处:网络
Whenever the m2eclipse plugin wants to download the source files of a Maven dependency I\'m getting the following error:

Whenever the m2eclipse plugin wants to download the source files of a Maven dependency I'm getting the following error:

java.lang.NullPointerException
    at org.eclipse.m2e.jdt.internal.BuildPathManager.attachSourcesAndJavadoc(BuildPathManager.java:845)
    at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.run(DownloadSourcesJob.java:165)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Do you know what the problem could be?开发者_StackOverflow社区


According to the source code the problem seems to be in this line:

      cp[i] = JavaCore.newLibraryEntry(entry.getPath(), srcPath, null, entry.getAccessRules(), //
          attributes.toArray(new IClasspathAttribute[attributes.size()]), // 
          entry.isExported());

I'm using the new Eclipse Indigo with the current Maven version.


I believe I ran into a problem with a similar symptom, but totally different cause, where the entry's getPath() was returning null.

If you turn on debug output in Preferences... Maven, I suspect you'll be shown the path.

If it's just one jar, you might check the dependency's pom and then check to see if the source jar is where it should be. It shouldn't blow up like this, of course, but stranger things have happened.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号