Community
Participate
Working Groups
The current way to make bundles auto starting with Tycho Surefire seems to be to specify a start level for them and using the "autoStart"-property there. If you have a lot of bundles that could use the default start level and just need to be started, thats a lot of unnecessary xml lines (e.g. about 200 lines for a test project I'm maintaining). Adding a way to make the auto start property configurable as it is for Eclipse Launch-Configurations would shorten those pom.xml-configuations considerably and improve their maintainability a lot. Same applies to the "default start level"-option, thats currently only configurable with this workaround aswell. Refer to https://dev.eclipse.org/mhonarc/lists/tycho-user/msg06183.html on how this request came to be.
Submitted a patch for review: https://git.eclipse.org/r/#/c/38018/ If approved, the default bundle start level could be configured: <configuration> <defaultStartLevel> <level>7</level> <autoStart>true</autoStart> </defaultStartLevel> </configuration> and is used for all bundles, where no bundleStartLevel is configured.
OSGi purists will say that auto-staring bundles is soooo wrong - but I'm not an OSGi purist so I don't object to this change ;-)
Did you check if we really need an explicit configuration switch for this? Wouldn't it be possible to just set the appropriate Equinox/OSGi system properties? If yes, we may not need to add any API to our surefire plugin at all. Note that there is an open bug that certain properties in the config.ini cannot be overridden from the POM, although they should be: bug 356193.
(In reply to Tobias Oberlies from comment #3) > Did you check if we really need an explicit configuration switch for this? > Wouldn't it be possible to just set the appropriate Equinox/OSGi system > properties? If yes, we may not need to add any API to our surefire plugin at > all. > > Note that there is an open bug that certain properties in the config.ini > cannot be overridden from the POM, although they should be: bug 356193. There is a osgi property for the start level ("osgi.bundles.defaultStartLevel") which was set in the config.ini hardcoded to 4 and which will be set to the specified parameter value in that patch. I could not find an osgi property for "autoStart". The Eclipse RCP launcher does write a bundls.info which contains the start level and auto start flag for each bunlde and that file gets passed as "org.eclipse.equinox.simpleconfigurator.configUrl" parameter in the config.ini. So you are right, when bug 356193 gets fixed, it will fix the issue that the default start level could not be set as system property. I couldn't find anything similar for the autoStart flag, which might emphasize your objection that autostarting bundles is wrong.
(In reply to Tobias Oberlies from comment #2) > OSGi purists will say that auto-staring bundles is soooo wrong - but I'm not > an OSGi purist so I don't object to this change ;-) globally auto-starting bundles might not be good practice but as a matter of fact the eclipse launch configuration offers it so I think it's reasonable for people expect Tycho will offer it too.
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required. 0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done if issue is still present when latest release: * Create a new issue at https://github.com/eclipse/tycho/issues/ ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience) ** In the GitHub description, start with a link to this bugzilla ticket ** Optionally add new content to the description if it can helps towards resolution ** Submit GitHub issue * Update bugzilla ticket ** Add to "See also" property (up right column) the link to the newly created GitHub issue ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>" ** Set status as CLOSED MOVED ** Submit All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.