You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Jess Bowers <jb...@me.com> on 2010/01/07 20:33:30 UTC
Buildr issue with ant task / Hash.from_java_properties
I have a buildr script that first loads a java properties file, then creates an ant task. I'm getting an abort error: Buildr aborted! org/apache/tools/ant/DefaultLogger when running buildr.
Here's the (simplified) buildfile:
CONFIG = Hash.from_java_properties("a=1")
define "my_project", :version => "1.0" do
ant("ant_test") do |ant_project|
# do something
end
end
I'm using Buildr 1.3.5 on OS X 10.6 with Ruby 1.8.7
stack trace:
** 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
Thanks
Jess
Re: very verbose ant task
Posted by Peter Schröder <ps...@blau.de>.
i tried the flag on the task AND all the buildr-settings.
the problem disappeared and i can't reproduce it right now. maybe there were some logging-jars in the wrong place...
Am 08.01.2010 um 14:48 schrieb Alex Boisvert:
> Are you saying the :verbose flag on the task isn't taken into account? I'm
> not sure I understand the issue.
>
> An alternative, or something to try, is to place the same task in a native
> ant xml file and run it from buildr.
>
> If you can create a smallish project to reproduce, I could spend a few
> cycles on it.
>
> alex
>
>
> On Fri, Jan 8, 2010 at 3:06 AM, Peter Schröder <ps...@blau.de> wrote:
>
>> hi,
>>
>> we use a xdoclet ant taks for creating or legacy ejb project. we wrote an
>> extension for this (described here
>> http://cwiki.apache.org/confluence/display/BUILDR/How+to+integrate+a+XDOCLET+task
>> ).
>>
>> this task logs it's output with some log setting, that i was not able to
>> configure properly.
>>
>> i played around with the verbose-settings of the task and buildr and the
>> silence-flag. nothing happend.
>>
>> we use an ivy plugin to manage our dependencies, which might cause the
>> behavior, but i did not find a good entry point for checking what is going
>> on.
>>
>> any ideas?
>>
>> kind regards,
>> peter
>>
>>
>>
Re: very verbose ant task
Posted by Alex Boisvert <al...@gmail.com>.
Are you saying the :verbose flag on the task isn't taken into account? I'm
not sure I understand the issue.
An alternative, or something to try, is to place the same task in a native
ant xml file and run it from buildr.
If you can create a smallish project to reproduce, I could spend a few
cycles on it.
alex
On Fri, Jan 8, 2010 at 3:06 AM, Peter Schröder <ps...@blau.de> wrote:
> hi,
>
> we use a xdoclet ant taks for creating or legacy ejb project. we wrote an
> extension for this (described here
> http://cwiki.apache.org/confluence/display/BUILDR/How+to+integrate+a+XDOCLET+task
> ).
>
> this task logs it's output with some log setting, that i was not able to
> configure properly.
>
> i played around with the verbose-settings of the task and buildr and the
> silence-flag. nothing happend.
>
> we use an ivy plugin to manage our dependencies, which might cause the
> behavior, but i did not find a good entry point for checking what is going
> on.
>
> any ideas?
>
> kind regards,
> peter
>
>
>
very verbose ant task
Posted by Peter Schröder <ps...@blau.de>.
hi,
we use a xdoclet ant taks for creating or legacy ejb project. we wrote an extension for this (described here http://cwiki.apache.org/confluence/display/BUILDR/How+to+integrate+a+XDOCLET+task).
this task logs it's output with some log setting, that i was not able to configure properly.
i played around with the verbose-settings of the task and buildr and the silence-flag. nothing happend.
we use an ivy plugin to manage our dependencies, which might cause the behavior, but i did not find a good entry point for checking what is going on.
any ideas?
kind regards,
peter
Re: Buildr issue with ant task / Hash.from_java_properties
Posted by Alex Boisvert <al...@gmail.com>.
The Java classpath isn't set up before your use Hash.from_java_properties so
that's why you're getting a (partial) ClassNotFoundException.
To work around this, you can add "Java.load" before
Hash.from_java_properties. Just make sure all your plugins are loaded and
initialized before your call to Java.load.
Documenting the Java bootstrap and providing a good practice for when to
call/trigger Java.load is on the list of things I'd like to do...
alex
On Thu, Jan 7, 2010 at 2:33 PM, Jess Bowers <jb...@me.com> wrote:
>
> I have a buildr script that first loads a java properties file, then
> creates an ant task. I'm getting an abort error: Buildr aborted!
> org/apache/tools/ant/DefaultLogger when running buildr.
>
> Here's the (simplified) buildfile:
>
> CONFIG = Hash.from_java_properties("a=1")
>
> define "my_project", :version => "1.0" do
>
> ant("ant_test") do |ant_project|
> # do something
> end
>
> end
>
> I'm using Buildr 1.3.5 on OS X 10.6 with Ruby 1.8.7
>
> stack trace:
>
> ** 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
>
>
> Thanks
> Jess
>
>