Tycho and Eclipse: How to resolve OSGI dependencies to my own bundles at development time within Eclipse, without opening all of them in the IDE

后端 未结 2 1727
天涯浪人
天涯浪人 2020-12-25 08:25

Background

My Eclipse RCP application is built using Tycho. It consists of multiple components (in the form of OSGi bundles/Eclipse plug-ins). One of these compon

相关标签:
2条回答
  • 2020-12-25 09:20

    As indicated by Nick Wilson, you will need to install the m2e Tycho Configurator, which basically "links up" Eclipse and Tycho (i.e., makes Tycho available in Eclipse).

    You should've been pointed towards it after having installed m2e, but you can also install it manually:

    1. Go to Window > Preferences > Maven > Discovery.

    2. Click the "Open Catalog" button. This will open the "m2e Marketplace" window.

    3. Search for "tycho", this should give you the "Tycho Configurator" as sole search result.

    4. Click "Finish", you're done.

    I've had this issue as well, and it isn't simple to find the solution, so I hope this helps!

    0 讨论(0)
  • 2020-12-25 09:25

    The "most automated" way to configure your target platform in Eclipse is to use a target file. That file can be checked in with your sources, so every developer only needs to open the file and click on "Set as Target Platform" to activate it. AFAIK there is no m2e connector or Eclipse plug-in which does that automatically.

    Given your development process, setting up this target file is a little more tricky. Since you don't have a feature which contains the latest version of all your bundles, you need to include the bundles directly in the target file. This is not possible via the rich editor, but can be done with a text editor:

    1. Create a target definition file, add your p2 repository, and select any feature from that p2 repository. Save the file.
    2. Open the target file in a text editor, remove the <unit> entry for the feature you added.
    3. Instead, add an entry for each of your bundles:

      <unit id="a.bundle.symbolic.name" version="0.0.0"/>
      

    This target file then contains the latest version of each of the listed bundles. To see the content, open the file with the "Target Editor" again and switch to the "Content" tab. This file can now be used by all developers.

    Note: When a new version of one of the bundles is deployed to Nexus, the developers will only see that new version if they open the target file and choose "Set as Target Platform" again.

    0 讨论(0)
提交回复
热议问题