Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] Extending Tycho

Maybe a mismatch between the version of Tycho you use with your plugin vs the version of Tycho you use in the Tycho Maven project ?


On Sat, Feb 1, 2014 at 12:20 AM, Gunnar Wagenknecht <gunnar@xxxxxxxxxxxxxxx> wrote:

I started writing a Maven plug-in today which makes re-use of some Tycho code. However, I seem to have issues with the whole project setup. Thus, I'm seeking for advice on how to proceed.

Right now I'm stuck with:
java.lang.ClassCastException: org.eclipse.tycho.core.osgitools.DefaultReactorProject cannot be cast to org.eclipse.tycho.ReactorProject
        at org.eclipse.tycho.core.osgitools.DefaultReactorProject.adapt(
        at org.eclipse.ebr.maven.BundleMojo.expandVersion(

There is some bug for this indicating that I have multiple versions of Tycho in my class path. I believe that is not the case. I have verified that all are of the same version. I beliebe it's related to the class being loaded multiple times which might be related to the lot of contained magic and dynamic loading under the covers that I'm not aware of. If anybode run into this before and has some details to share I'd really appreciate that.

FWIW, I was able to work around this by falling back to reflection. :( I also tried adding my own packaging type, but it doesn't seem to get recognized.

I tried a declaration similar to AbstractTychoPackagingMojo in my Mojo:
 @Component(role = TychoProject.class)
 private Map<String, TychoProject> projectTypes;

But my project type does not appear in the list even though it's defined correctly in the projects POM and recognized by Maven. Might be related to the class loading issues?


Gunnar Wagenknecht

tycho-dev mailing list


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

Back to the top