~ubuntu-branches/ubuntu/quantal/maven-invoker-plugin/quantal

« back to all changes in this revision

Viewing changes to src/main/java/org/apache/maven/plugin/invoker/BeanShellScriptInterpreter.java

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Landaeta
  • Date: 2011-09-06 20:06:24 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110906200624-n9hj2b0m9bx0pwtd
Tags: 1.5-2
* Team upload.
* Add Build-Depends on libmaven-plugin-tools-java (>= 2.8) (Closes: #640751)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import java.util.List;
27
27
import java.util.Map;
28
28
 
 
29
import bsh.Capabilities;
29
30
import bsh.EvalError;
30
31
import bsh.Interpreter;
31
32
import bsh.TargetError;
34
35
 * Provides a facade to evaluate BeanShell scripts.
35
36
 * 
36
37
 * @author Benjamin Bentmann
37
 
 * @version $Id: BeanShellScriptInterpreter.java 684549 2008-08-10 16:30:43Z bentmann $
 
38
 * @version $Id: BeanShellScriptInterpreter.java 737521 2009-01-25 15:22:26Z bentmann $
38
39
 */
39
40
class BeanShellScriptInterpreter
40
41
    implements ScriptInterpreter
61
62
                engine.setOut( scriptOutput );
62
63
            }
63
64
 
 
65
            if ( !Capabilities.haveAccessibility() )
 
66
            {
 
67
                try
 
68
                {
 
69
                    Capabilities.setAccessibility( true );
 
70
                }
 
71
                catch ( Exception e )
 
72
                {
 
73
                    if ( scriptOutput != null )
 
74
                    {
 
75
                        e.printStackTrace( scriptOutput );
 
76
                    }
 
77
                }
 
78
            }
 
79
 
64
80
            if ( classPath != null && !classPath.isEmpty() )
65
81
            {
66
82
                for ( Iterator it = classPath.iterator(); it.hasNext(); )
102
118
            {
103
119
                throw new ScriptEvaluationException( e.getTarget() );
104
120
            }
105
 
            catch ( Exception e )
 
121
            catch ( ThreadDeath e )
 
122
            {
 
123
                throw e;
 
124
            }
 
125
            catch ( Throwable e )
106
126
            {
107
127
                throw new ScriptEvaluationException( e );
108
128
            }