diff --git a/lib/cerberus/builder/maven2.rb b/lib/cerberus/builder/maven2.rb index 3d1a680..043258b 100644 --- a/lib/cerberus/builder/maven2.rb +++ b/lib/cerberus/builder/maven2.rb @@ -11,11 +11,22 @@ class Cerberus::Builder::Maven2 Dir.chdir @config[:application_root] cmd = @config[:builder, :maven2, :cmd] || 'mvn' task = @config[:builder, :maven2, :task] || 'test' - @output = `#{@config[:bin_path]}#{cmd} #{task} 2>&1` + @output = `#{@config[:bin_path]}#{cmd} #{system_properties} #{task} 2>&1` add_error_information successful? end + def system_properties + properties = [] + system_properties = @config[:builder, :maven2, :system_properties] + if system_properties + system_properties.each do |p| + properties << "-D#{p[0]}=\"#{p[1]}\"" + end + end + properties.join(" "); + end + def successful? $?.exitstatus == 0 and not @output.include?('[ERROR] BUILD FAILURE') end