Christoph Läubrich created SUREFIRE-2054:
--------------------------------------------

             Summary: Support pluggable starters
                 Key: SUREFIRE-2054
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2054
             Project: Maven Surefire
          Issue Type: Improvement
            Reporter: Christoph Läubrich


Currently Surefire has two (internal) Starters:

Forked:
https://github.com/apache/maven-surefire/blob/daf717e65716e3e77951757596c11d83754338e2/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java#L2437

InProcess:
https://github.com/apache/maven-surefire/blob/daf717e65716e3e77951757596c11d83754338e2/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java#L2454

[Tycho|https://www.eclipse.org/tycho/sitedocs/tycho-surefire-plugin/plugin-info.html]
 (and 
[BND|https://github.com/bndtools/bnd/tree/master/maven/bnd-testing-maven-plugin])
 both offer "surefire-like" plugins that internally use surefire/junit.

I think this is a bit wasted effort, as actually most parts of surefire 
(configuration and alike) could simply be reused, both plugins simply need a 
mean to start the process differently.

My idea would be to make the Starters plugable, like one can plug in different 
platforms. Lookin at both Forked/InProcess the share a lot of common parameters 
and the run methods only differ in passing the effectiveProperties.

So I think it should be possible to derive a common "SurefireStarter" interface 
that an extender has to implement togehter with a "SurefireStarterFactory" that 
is used to construct such a starter passing the necessary information (e.g. the 
AbstractSurefireMojo and selected providers and so on...). 

Of course this would be more an SPI than a API and result in rather tightly 
coupled plugins, but could make all this more reusable.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to