@@ -41,7 +41,7 @@ public class CompileMojo extends AbstractJRubyMojo {
41
41
/**
42
42
* do not fail the goal
43
43
*/
44
- @ Parameter ( property = "jrubyc.ignoreFailue " , defaultValue = "false" )
44
+ @ Parameter ( property = "jrubyc.ignoreFailure " , defaultValue = "false" )
45
45
protected boolean ignoreFailures ;
46
46
47
47
/**
@@ -82,7 +82,14 @@ else if (!this.outputDirectory.exists()) {
82
82
83
83
final Script script = this .factory .newScript (
84
84
"\n require 'jruby/jrubyc'\n "
85
- + "status = JRubyCompiler::compile_argv(ARGV)\n "
85
+ + "status = 0\n "
86
+ + "begin\n "
87
+ + " status = JRubyCompiler::compile_argv(ARGV)\n "
88
+ + "rescue Exception\n "
89
+ + " puts \" Failure during compilation of file #{ARGV}:\\ n#{$!}\" \n "
90
+ + " puts $!.backtrace\n "
91
+ + " status = 1\n "
92
+ + "end\n "
86
93
+ "raise 'compilation-error(s)' if status !=0 && !"
87
94
+ this .ignoreFailures );
88
95
@@ -93,7 +100,7 @@ else if (!this.outputDirectory.exists()) {
93
100
script .addArg ("-t" , fixPathSeparator (this .outputDirectory ));
94
101
}
95
102
96
- if ( getJrubyVersion (). hasJRubycVerbose () && ( this .jrubyVerbose || this .jrubycVerbose ) ){
103
+ if (this .jrubyVerbose || this .jrubycVerbose ){
97
104
script .addArg ("--verbose" );
98
105
}
99
106
// add current directory
@@ -106,4 +113,4 @@ private String fixPathSeparator(final File f) {
106
113
// http://jira.codehaus.org/browse/JRUBY-5065
107
114
return f .getPath ().replace (System .getProperty ("file.separator" ), "/" );
108
115
}
109
- }
116
+ }
0 commit comments