private static String detectRuntime()

in maven-artifact-transfer-api/src/main/java/org/apache/maven/shared/transfer/support/Selector.java [48:80]


    private static String detectRuntime()
    {
        // go from older to newer?
        String runtime = null;
        try
        {
            Trap.MAVEN_3_0_X.check();
            runtime = MAVEN_3_0_X;
        }
        catch ( Trap.TrapException e )
        {
            // skip
        }
        if ( runtime == null )
        {
            try
            {
                Trap.MAVEN_3_1_X.check();
                runtime = MAVEN_3_1_X;
            }
            catch ( Trap.TrapException e )
            {
                // skip
            }
        }

        if ( runtime == null )
        {
            // if here, die
            throw new IllegalStateException( "Could not determine runtime" );
        }
        return runtime;
    }