WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Re: svn commit: r1042246 [1/2] - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/main/java/org/apache/mave

Re: svn commit: r1042246 [1/2] - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/main/java/org/apache/mave

by Stephen Connolly-2 :: Rate this Message:

| View in Thread

On 4 December 2010 22:16, <krosenvold@...> wrote:

> Author: krosenvold
> Date: Sat Dec  4 22:16:45 2010
> New Revision: 1042246
>
> URL: http://svn.apache.org/viewvc?rev=1042246&view=rev
> Log:
> [SUREFIRE-408] Made it possible to explicitly specify provider
>
> ServiceProvider code by Stephen Connolly
>
> @@ -564,16 +574,36 @@ public class SurefirePlugin
>      */
>     private ToolchainManager toolchainManager;
>
> +    private PlexusContainer container;
> +
> +
> +    public void contextualize( Context context )
> +        throws ContextException
> +    {
> +        container = (PlexusContainer) context.get(
> PlexusConstants.PLEXUS_KEY );
> +    }
>
>     public void execute()
>         throws MojoExecutionException, MojoFailureException
>     {
> +        final WellKnownProvider provider = initialize();
>         if ( verifyParameters() )
>         {
>             final Classpath bootClasspathConfiguration = new Classpath();
>             ForkConfiguration forkConfiguration =
> getForkConfiguration(bootClasspathConfiguration);
>
> -            BooterConfiguration booterConfiguration =
> createBooterConfiguration( forkConfiguration );
> +            BooterConfiguration booterConfiguration =
> createBooterConfiguration( forkConfiguration, provider );
> +
> +            try
> +            {
> +                final Set objects =
> +                    ProviderDetector.getServiceNames(
> SurefireProvider.class, Thread.currentThread().getContextClassLoader());
> +                System.out.println(objects);
>
Is this intentional?

> +            }
> +            catch ( IOException e )
> +            {
> +                e.printStackTrace();  //To change body of catch statement
> use File | Settings | File Templates.
>
Is this intentional?

> +            }
>
>             getLog().info(
>                 StringUtils.capitalizeFirstLetter( getPluginName() ) + "
> report directory: " + getReportsDirectory() );
>
>
Otherwise looks good ;-)

 « Return to Thread: Re: svn commit: r1042246 [1/2] - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/main/java/org/apache/mave