Plugin will put sourcepath attribute on classpathentry elements, regardless if file exists or not.
Patch attached will only supply sourcepath attribute if the source archive exists.
This will cause errors in eclipse when you dont have the source files available. For instance, if you have run a program and have a stack trace in your console and you click on a link to a file/line number in the stack trace of one of your source files, you will get something similar to this:
An exception occurred while following link. Reason: Error logged from JDT Debug UI:
Error logged from JDT Debug UI:
Source lookup error
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\junit\java-sources\junit-3.8.1-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-logging\java-sources\commons-logging-1.0.3-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-lang\java-sources\commons-lang-2.0-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-net\java-sources\commons-net-1.3.0-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\sshtools\java-sources\sshtools-maverick-all-1.2.7-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\jboss\java-sources\jboss-jmx-4.0.3SP1-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-httpclient\java-sources\commons-httpclient-2.0.2-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-collections\java-sources\commons-collections-3.1-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\jboss\java-sources\jboss-system-4.0.3SP1-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\jboss\java-sources\jboss-common-4.0.3SP1-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\servletapi\java-sources\servletapi-2.4-20040521-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-validator\java-sources\commons-validator-1.1.4-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-beanutils\java-sources\commons-beanutils-1.6-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\jboss\java-sources\jmx-adaptor-plugin-4.0.3SP1-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\dom4j\java-sources\dom4j-1.6.1-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\jaxen\java-sources\jaxen-1.1-beta-4-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\commons-digester\java-sources\commons-digester-1.6-sources.jar
Unable to access archive C:\Documents and Settings\jchristi\.maven\repository\oro\java-sources\oro-2.0.7-sources.jar
Stack trace in Eclipse's error log shows:
org.eclipse.core.runtime.CoreException: Source lookup error
at org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.findSourceElements(CompositeSourceContainer.java:104)
at org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.findSourceElements(CompositeSourceContainer.java:45)
at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant.findSourceElements(AbstractSourceLookupParticipant.java:67)
at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:136)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.findSourceElements(AbstractSourceLookupDirector.java:721)
at org.eclipse.jdt.internal.debug.core.JavaDebugUtils.resolveSourceElement(JavaDebugUtils.java:262)
at org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink.getSourceElement(JavaStackTraceHyperlink.java:130)
at org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink.linkActivated(JavaStackTraceHyperlink.java:85)
at org.eclipse.ui.console.TextConsoleViewer$2.handleEvent(TextConsoleViewer.java:103)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)