Bug 454785 - Make "Default Auto-Start" and "Default Start Level"-option configurable for Tycho Surefire
Summary: Make "Default Auto-Start" and "Default Start Level"-option configurable for T...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 12:44 EST by Katrin Straßl CLA
Modified: 2021-04-28 16:52 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Straßl CLA 2014-12-10 12:44:31 EST
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.
Comment 1 Martin Schreiber CLA 2014-12-11 06:09:59 EST
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.
Comment 2 Tobias Oberlies CLA 2014-12-15 05:24:23 EST
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 ;-)
Comment 3 Tobias Oberlies CLA 2014-12-15 05:28:54 EST
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.
Comment 4 Martin Schreiber CLA 2014-12-15 06:31:48 EST
(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.
Comment 5 Jan Sievers CLA 2014-12-15 06:42:19 EST
(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.
Comment 6 Mickael Istria CLA 2021-04-08 18:10:28 EDT
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.