Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] Issues with ITs

what you are seeing looks like a conflict between the plexus-interpolation version used by tycho-core vs the plexus-interpolation version used by tycho-p2-publisher-plugin at runtime (maven ITs are executed using maven 3.0 for backwards compat so you should see the same problem when doing a test build using maven 3.0).

plexus-interpolation comes with maven as part of the maven bootclasspath in $M2_HOME/lib and IIRC the maven classloader architecture will force all artifact versions that are part of the bootclassspath to the bootclasspath version, I think this is basically a maven classloader limitation.

Things you can try:

- avoid exposing any plexus classes as part of your interface. Define your own interface instead and hide the plexus implementation behind it.
- add dependencyManagement for plexus-interpolation in the parent pom to manage the version to be used globally (not sure if this will work due to the bootclasspath problem above though)
- you can check dependency management using the filtering on the "Dependency Hierarchy" tab of m2e's pom.xml editor

plexus shipped with maven has changed considerably since maven 3.0 and it's considered "maven internal/not API" if I'm not mistaken.
If we can't fix this we may have to find a different solution for ${variable} replacement by avoiding to use plexus classes altogether.

@Igor any hints?

Jan

From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-bounces@xxxxxxxxxxx] On Behalf Of SCHREIBER.Martin
Sent: Freitag, 14. November 2014 12:53
To: tycho-dev@xxxxxxxxxxx
Subject: [tycho-dev] Issues with ITs

Hi,

I submitted a patch (https://git.eclipse.org/r/#/c/35705/) and made the mistake to not run the it tests locally before pushing - SORRY for that.
Now some tests are failing (locally and on hudon) and I do not know why. I did not introduced new dependency in any pom or manifest file but get this error: 


(at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
        ... 20 more
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.eclipse.tycho.core.maven.InterpolatorFactory.createInterpolator(Lorg/apache/maven/execution/MavenSession;Lorg/apache/maven/project/MavenProject;)Lorg/codehaus/plexus/interpolation/Interpolator;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current class, org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, org/eclipse/tycho/core/maven/InterpolatorFactory, have different Class objects for the type .createInterpolator(Lorg/apache/maven/execution/MavenSession;Lorg/apache/maven/project/MavenProject;)Lorg/codehaus/plexus/interpolation/Interpolator; used in the signature
        at org.eclipse.tycho.plugins.p2.publisher.PublishProductMojo.publishContent(PublishProductMojo.java:93)
        at org.eclipse.tycho.plugins.p2.publisher.AbstractPublishMojo.execute(AbstractPublishMojo.java:37)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
        ... 20 more

What I did is i created a new class within tycho-core which is using the org.codehaus.plexus.interpolation.Interpolator but as I said, I did not had to add a new dependency to the pom.xml file. It looks that "only" the tests are failing. If I run tycho with different plugin/feature/product locally, everything works fine.

Does anyone have a hint for me?
Thanks!
Martin



Back to the top