public void execute()
        throws MojoFailureException
    {
        Interpreter interpreter = new Interpreter();

        set( interpreter, "project", getProject() );
        set( interpreter, "session", mavenSession );
        set( interpreter, "settings", settings );

        try
        {
            interpreter.eval( source );
        }
        catch ( EvalError ee )
        {
            MojoFailureException mfe =
                new MojoFailureException( "error during Beanshell script execution: " + ee.getMessage() );
            mfe.initCause( ee );
            throw mfe;
        }

        if ( properties != null )
        {
            for ( String property : properties )
            {
                Object value;
                try
                {
                    value = interpreter.get( property );

                    if ( value != null )
                    {
                        defineProperty( property, value.toString() );
                    }
                }
                catch ( EvalError ee )
                {
                    MojoFailureException mfe = new MojoFailureException( "cannot get Beanshell global variable '"
                        + property + "': " + ee.getMessage() );
                    mfe.initCause( ee );
                    throw mfe;
                }
            }
        }
    }
public void execute ( ) throws MojoFailureException { Interpreter interpreter = new Interpreter ( ) ; set ( interpreter , "project" , getProject ( ) ) ; set ( interpreter , "session" , mavenSession ) ; set ( interpreter , "settings" , settings ) ; try { interpreter . eval ( source ) ; } catch ( EvalError ee ) { MojoFailureException mfe = new MojoFailureException ( "error during Beanshell script execution: " + ee . getMessage ( ) ) ; mfe . initCause ( ee ) ; throw mfe ; } if ( properties != null ) { for ( String property : properties ) { Object value ; try { value = interpreter . get ( property ) ; if ( value != null ) { defineProperty ( property , value . toString ( ) ) ; } } catch ( EvalError ee ) { MojoFailureException mfe = new MojoFailureException ( "cannot get Beanshell global variable '" + property + "': " + ee . getMessage ( ) ) ; mfe . initCause ( ee ) ; throw mfe ; } } } }
Main plugin execution