Eclipse Tycho: Disable p2 dependency resolution with tycho.mode=maven

In Eclipse Tycho based builds the first step is always computation of the target platform and depedency resolution. This takes quite some time and in certain use cases it is not necessary. Typical use cases are updating versions with the tycho-versions-plugin, or displaying the effective pom with help:effective-pom.

The p2 target platform & dependency resolution can be skipped by setting the tycho-mode system property:

mvn -Dtycho.mode=maven <goals>

This useful feature is a bit hidden in just a few posts, e.g. https://www.eclipse.org/lists/tycho-user/msg06439.html.

Minimal Run Configuration for GMF Diagram Testing

I’m currently on developing a GMF editor again and so I have to restart a runtime Eclipse instance very often. To reduce the rountrip times I have set up a rather minimal Run Configuration. These are the steps to create it:

  1. Create a new Run Configuration Run -> Run Configurations… -> Eclipse Application
  2. On the Main tab select Program to Run -> Run an application -> org.eclipse.ui.ide.workbench
  3. Switch to tab Plug-ins and select Launch with -> plug-ins selected below only
  4. Press the button Deselect All
  5. Open the Workspace tree node and select the plugins that should be tested. In my case these are 3 plugins (models, diagram, edit plugin)
  6. Deselect the checkbox “Include optional dependencies when computing required plug-ins”
  7. Press the button Add Required Plug-ins
  8. Select the plugin org.eclipse.ui.ide.application and press Add Required Plug-ins again

After this I have just 129 plugins selected (my target platform contains 1396, my Eclipse IDE even far more), so I could reduce the amount of plugins for testing my diagram plugin to less than 10%!

The configuration could even be more minimal. Unfortunately the plugins org.eclipse.team.core and org.eclipse.team.ui are in this configuration and could not be removed, since they are required plug-ins for org.eclipse.ltk.ui.refactoring. If the team dependencies were optional for this plugin this would be resolved. There is Bug#281223 open dealing this issue.

I experienced problems starting the org.eclipse.ui.forms plugin, resulting in this stack trace:

The activator org.eclipse.ui.internal.forms.FormsPlugin for bundle org.eclipse.ui.forms is invalid
...
caused by: java.lang.NoClassDefFoundError: org/eclipse/ui/plugin/AbstractUIPlugin

Fortunately I found this posting. I removed the o.e.u.forms plugin, started the run configuration (failing of course), added the plugin again to the run config and then my problem was gone.