Skip to main content

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

Hi Adrian,

It does work, but it's difficult to say more than this since you're conflating several issues. Firstly, you ask if a Tycho project can follow default Maven structure, but then suddenly jump to ask if PDE supports default Maven structure. Secondly, the error you mention is about location of class files, but you for some reason ask about location of source files too. Thirdly, there is no magic about "self-hosting". It's like hosting in any other p2 application but using own p2 repos. All of this is confusing me.

If I were you, I'd try couple things. First of all, build.properties I've seen so far always included a dot (".") in bin.includes. I haven't reflected about this but think it's suspiciout that the dot is missing in your case. Secondly, I suggest that you export your product and inspect offending jar file manually. Does it really have classes? Where are they?

My theory is PDE indeed has built-in support for classes in bin/ directory but if they end up elsewhere bin.includes should include (heh?) the path to them.

Kind regards,
Mikhail Kalkov

Kind regards,
Mikhail Kalkov

2015-09-28 18:21 GMT+02:00 Adrian Price <aprice@xxxxxxxxx>:
Sorry - I made a mistake when editing out some irrelevant stuff in build.properties, which should have read:
bin.includes = META-INF/,\
               plugin.properties,\
               plugin.xml

On 28 September 2015 at 17:15, Adrian Price <aprice@xxxxxxxxx> wrote:
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


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top