Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Tycho, Maven & PDE runbench classpath compatibility issues

Good day tycho-user@xxxxxxxxxxx,

There are several postings on related topics but I should like to ask the specific question:

Q: For an Eclipse plug-in project being built by Maven and Tycho, is it even possible to use to the Maven default project structure whereby Java sources live in src/main/java and get compiled to target/classes, and if so, how?

My experience is that if you have this .classpath:
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

and this build.properties:
source.. = src/main/java/
output.. = target/classes/
bin.includes = .META-INF/,\
               plugin.properties,\
               plugin.xml,\

then in a self-hosted runbench (Run|Debug As > Eclipse Application), the plug-in is unable to load any of its classes because the class loader tries to resolve the class file path relative to the location of the workspace project root rather than that project's target/classes directory. The only way I've found to get self-hosting to work is to change everything back to the PDE defaults of <classpathentry kind="output" path="bin"/> and output.. = bin/ ; then, under the debugger, one can observe the class loader magically resolving the class file's path relative to the <project>/bin directory in the workspace, using a org.eclipse.osgi.storage.bundlefile.NestedDirBundleFile.

I'm suspecting that PDE (or somewhere) might have some hard-coded reliance on a bin directory. All the Tycho examples I've seen use src and bin directories.

Could anyone confirm this limitation or suggest a way to get self-hosting to work?

Thanks,

--A

Back to the top