In Eclipse in the Java Build Path, I assigned a javadoc jar to a library by selecting “Javadoc in archive”, then giving the path in my project like myProject/lib/doc/spring-framework-3.1.3-RELEASE-javadoc.jar. With this, the eclipse task chokes:
robert@pferdeapfel:~/pmc/1808/powermta> gradlew eclipse -s :eclipseClasspath FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:eclipseClasspath’. > Cannot parse file ‘/Users/robert/myProject/.classpath’.
Perhaps this file was tinkered with? In that case try delete this file and then retry.
… Caused by: org.gradle.api.GradleException: Cannot parse file ‘/Users/robert/myProject/.classpath’.
Perhaps this file was tinkered with? In that case try delete this file and then retry. … Caused by: java.lang.IllegalArgumentException: URI scheme is not “file”
at org.gradle.plugins.ide.eclipse.model.internal.FileReferenceFactory.fromJarURI(FileReferenceFactory.groovy:77)
Looking at .classpath in an editor, the entry in question is
<classpathentry kind="lib" path="lib/org.springframework.core-3.1.3.RELEASE.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/myProject/lib/doc/spring-framework-3.1.3-RELEASE-javadoc.jar!/"/>
</attributes>
</classpathentry>
Is that expected?
Even if I change the Eclipse setting from Workspace File to External File, Eclipse does not put a file: URI in. In my example I got
<attribute name="javadoc_location" value="jar:file:/Users/robert/myProject/lib/doc/spring-framework-3.1.3-RELEASE-javadoc.jar!/"/>
Of course I don’t want to use this cause the absolute path would break the location for everybody else on the team.
What do I need to change to make both Eclipse and Gradle happy?
Thanks,
Robert