2010-01-06 4 views
1

Java 빌드 파일을 먼저로드 한 다음 ant 태스크를 작성하는 buildr 스크립트가 있습니다. 중단 오류가 발생했습니다 : Buildr가 중단되었습니다. org/apache/tools/ant/DefaultLogger를 실행하면됩니다. 여기 Apache 작업 빌드 문제 (ant 작업/Hash.from_java_properties)

은 (간체) 빌드 파일입니다 :

CONFIG = Hash.from_java_properties("a=1") 

define "my_project", :version => "1.0" do 

    ant("ant_test") do |ant_project| 
    # do something 
    end 

end 

내가 루비 1.8.7로 OS X 10.6에 Buildr 1.3.5을 사용하고

스택 추적 :

** Invoke my_project (first_time) 
** Execute my_project 
Defining task my_project:shell:jirb 
Defining task my_project:shell:clj 
Defining task my_project:shell:bsh 
** Invoke /Users/jsbowers/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar (first_time, not_needed) 
** Invoke /Users/jsbowers/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar (first_time, not_needed) 
** Invoke /Users/jsbowers/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar (first_time, not_needed) 
** Invoke /Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java (first_time, not_needed) 
Buildr aborted! 
org/apache/tools/ant/DefaultLogger 
/Library/Ruby/Gems/1.8/gems/Antwrap-0.7.0/lib/rjb_modules.rb:16:in `import' 
/Library/Ruby/Gems/1.8/gems/Antwrap-0.7.0/lib/rjb_modules.rb:16 
/Library/Ruby/Gems/1.8/gems/Antwrap-0.7.0/lib/ant_project.rb:86:in `initialize' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java/ant.rb:74:in `new' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/java/ant.rb:74:in `ant' 
/Users/jsbowers/tmp/buildr_test/buildfile:9 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/project.rb:225:in `instance_exec' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/project.rb:225:in `define' 
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' 
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' 
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' 
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/project.rb:625:in `execute' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:146:in `switch_to_namespace' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/project.rb:624:in `execute' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:630:in `invoke_with_call_chain' 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:616:in `invoke_with_call_chain' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:611:in `invoke' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/util.rb:204:in `__send__' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/util.rb:204:in `to_proc' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/project.rb:281:in `each' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/project.rb:281:in `projects' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/project.rb:863:in `projects' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:400:in `raw_load_buildfile' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:218:in `load_buildfile' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:496:in `standard_exception_handling' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:213:in `load_buildfile' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:137:in `run' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:496:in `standard_exception_handling' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/lib/buildr/core/application.rb:135:in `run' 
/Library/Ruby/Gems/1.8/gems/buildr-1.3.5/bin/buildr:19 
/usr/bin/buildr:19:in `load' 
/usr/bin/buildr:19 

답변

2

Buildr 메일 링리스트에서 대답하는대로 Hash.from_java_properties으로 전화하기 전에 Java.load을 추가해야 RJB *가 올바르게 초기화됩니다.

이것은 일반적으로 buildfile이로드 된 후 자동으로 수행되지만로드 단계에서 Java 객체를 사용하기 때문에 Buildr에 명시 적으로 알려야합니다.

(*) RJB = Ruby-Java Bridge

+0

위대한 작품, 고마워! –

1

사운드 클래스 패스 문제와 비슷하지만, 여러분이 제공 한 정보로는 확실히 말할 수 없습니다. buildr --trace을 실행하고 전체 결과를 게시 해보십시오.

그냥 그렇지만이 종류의 질문은 Buildr Users 메일 링리스트에서 가장 쉽게 질문하고 대답 할 수 있습니다.

+0

아,하지만 저는 스택 오버플로가 너무 좋아요 .... 그렇게 잘못 됐나요? –

+0

추적을 추가하고 또한 목록에 게시했습니다. 팁 고마워. –