-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tycho 3.0.0 incompatibilities #297
Comments
Can corroborate and evaluate: It started working for me with Maven 3.6.3. (Skipped the intervening versions, because I was too lazy to install them and it is a Tycho/Maven issue anyway, but it serves to demonstrate, that the promise of Reficio, that it is going to work with Maven up to 3.2 is likely void for recent versions of Tycho) It is also working with Tycho 2.7.5 and Maven 3.8.6 But it actually stops working with Tycho 3.0.0 -> Obviously, Tycho 3.0.0 breaks the Reficio:p2-maven-plugin. |
In eclipse-tycho/tycho@72747e7 |
It is more complicated than just that, I investigated further:
|
Thanks for analyzing the problem. Would it be helpful for your patch to prepare an update to the last 2.x version of Tycho (including a release) and update the master branch to Java 17. It seems that Java 17 is mandatory for Tycho 3.x |
It would certainly not hurt. To an extend, it would depend on how comfortable you feel about switching to 17 coming from 8, in my carrer, I encountered a lot of organizations really conservative on JDK updates, that weren't too lucky about getting that pushed down their throat. I found that a surpringly bold move on part of tycho. Just as surprising as skiping to Maven 3.8.3 from 3.2.x. But I'm the last one to complain, and would be comfortable leaving them behind. When switching to 2.7.5, the last pre 3.0 Tycho release, make sure to match their maven-version on your build, so you can rely on Javas compile time guarantees. But you should point out these changes on your readme, i. e. updating your prerequisites. (Tycho seemes to miss this too). The patch is going to take some time. Following @bjmjs hint shows, that Tycho replaced the P2ApplicationLauncher essentially with nothing. |
As a workaround we could split our build into a "p2" build and "tycho" build and could circumvent the tycho version dependence. |
Hm. I'm not that familiar with all that stuff, I'm still struggling to wrap my head around the mess that is stacking OSGi, Equinox and Tycho on top of each other, let alone to start an OSGi service within a maven build. Is a catalog an Equinoxe or a Tycho thing? So it boils down to the question: how expensive is it to do this without Tycho? |
@gtsh p2 maven plugin tried to reuse already existing implementation from maven bundle plugin and Tycho. IMHO Tycho started a new way how to handle maven artifacts in a Tycho build (see this blog post and a Twitter discussion). Also, they created a bunch of new p2 plugins (Had no time to analyze them). First Idea: Maybe we can move the deleted code to this plugin and try to reduce the dependency to Tycho. I need some time to analyze that. |
Meanwhile I experimented a bit on my own, and found out, that this might be way over my head. |
Some more hints, you might already know: https://rtist.hcldoc.com/help/topic/org.eclipse.platform.doc.isv/guide/p2_publisher.html#category_publisher has the command line invocation of the CategoryPublisherApplication. The startup - as mentioned above - actually fails for me, because the org.eclipse.equinox.internal.p2.publisher.Activator hasn't its BundleContext set. |
- replace P2ApplicationLauncher by TychoFeaturesAndBundlesPublisherApplication
@gtsh I had some time to go deeper into the analysis. I t seems we can use the CatogoryPublisherApplication directly in the code if an embedded Equinox is started (therefore you got a NullPointerException). Tycho has already implemented an equinox sisu integration. I need some time to figure out how it works (currently I don't find a documentation about it) |
I actually figured as much, but was not able to pinpoint, how Tycho starts its OSGi-Context. A detail of that is the question, whether this would be a unique OSGi container started once for the complete maven lifecycle and then reused, or whether you may have one just for that one mojo execution. In the back of my mind is, that it might be possible, to inject Tycho's mojo into ours, then delegate. If we are lucky, the mojo knows, how and when to create the container, or to join an existing one. Else, it might be possible, to build a trivial project with just that mojo, to explore with the debugger. |
Hi @gtsh, I tried out to call 'mvn org.eclipse.tycho:tycho-p2-plugin:3.0.0:category-p2-metadata' manually. But without a Tycho context, I get a NullPointerExeption. I think this problem is similar to the problem that is described in this Tycho issue Currently, it seems, I had to move the old Tycho logic to this plugin or find out how to use the equinox sisu integration. |
Any more progress or new ideas how to get this solved? |
I just ran into this issue myself. I'm working on a project that will typically perform a major upgrade of all its dependencies once a year, and sadly this is the third year in a row where I had to upgrade to Tycho 3.0.5 (from 2.7.5) for other reasons, and as @gtsh and @bjmi have already pointed out, the 3.0.5 version of At any rate, does anyone have any progress to report this issue? (fork with a fix, work-around, alternative plugin?) |
- prepare build setup for java 17
Hi @daniel-matheis-vivavis, @raner, I started an implementation, where I try to merge Tycho old logic in this plugin. It doesn't work well. In https://github.com/sparsick/p2-maven-plugin/tree/297-updateTycho3 you can find the current state of my implementation. Which options we have?
Currently, I can't find time to finish it (this issue has currently not so high priority in my projects). But I could answer questions if someone want to finish it. |
Thanks for your prompt reply, @sparsick :-) and thanks for sharing a starting point for an implementation. It seems that the key will be to find a replacement for I'm still looking at the läubisoft blog article you shared, but it seems it has a lot of manual steps, which might not work for me since I need to be able to consume updated versions of dependencies in a fully automated fashion from within the Maven build. If a version update of a dependency requires a manual step, this approach won't really work. In the meantime, I might have found a way to stay on Tycho 2.7.5 for my project. If I can make that work, hopefully, |
My naive approach was to just copy and paste the deleted classes from the Tycho project to the plugin. But the integration tests fail with errors (I don't have them to hand right now). This commit removes the original P2ApplicationLauncher. |
Running
p2:site
with Maven 3.8.6 and Tycho 3.0.0 ends up withThe text was updated successfully, but these errors were encountered: