2

I´m building an RCP application using tycho. The RCP application uses p2 and its self updateable capabilities configuring the respository in an p2.inf file. Works like a charm.

Now I want to introduce a placeholder ${updatesiteurl} in the p2.inf file and replace it with the URL according to the environment for which it is built. But unforunately it get´s replaced with an empty string instead of the environment variable which I guess happens because tycho, or the p2 director, replaces some escaped characters (like the ":" which is ${58} for example).

Any ideas how this could be solved? I thought about explicitly declaring the resource plugin and binding it to an earlier build phase but that didn´t work either...

oberlies
  • 11,503
  • 4
  • 63
  • 110
Alexander Hansen
  • 813
  • 8
  • 14
  • How did you get your RCP application to be updateable. Any features that I include in my target I can't update. It seems related to this bug: [361722](https://bugs.eclipse.org/bugs/show_bug.cgi?id=361722) I was just wondering how you worked around it. – Erik Englund Dec 20 '13 at 21:30
  • I basically followed this guide: http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_RCP_Application - I´m not aware of the bug you linked here, but maybe we will discover this soon, because I´m about to add a VM to the installation as a feature to be able to update the VM with the application. – Alexander Hansen Dec 22 '13 at 11:53

1 Answers1

2

What finally worked is: I moved the p2.inf file to directory /p2 and let the maven resource plugin copy the file with the replacements to a temporary folder in /target. Now a copy task copies the file in a later phase (why the hell didn´t this work in the same phase...) to the the root directory, where the .product file is, since both have to be in the same directory (with the same prefix). Finally clean deletes the p2.inf file in the root directory...

Alexander Hansen
  • 813
  • 8
  • 14
  • Good solution - though it is peculiar that the packaging mojo for features cannot find the p2.inf in the target directory.... That would really help! – Tonny Madsen Feb 05 '16 at 06:38
  • Maybe this has been fixed/changed in the recent time, it's been a while since I came up with the solution. I'm not working on eclipse stuff anymore (sad music sets in...) – Alexander Hansen Feb 05 '16 at 06:57
  • Unfortunately, the code that reads and applies the p2.inf file is found in the p2 part of the solution - not in the Maven/Tycho part. So it does not know about alternative locations, etc... – Tonny Madsen Feb 09 '16 at 07:29