You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Ingo Schmidt <an...@der-ingo.de> on 2013/08/02 14:48:31 UTC

Default Scope of Dependencies

Hi all,

I have a question about the default scope of dependencies in buildr. 
According to 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html 
the compile scope is the default, if no scope is specified.
However, if I run this code in buildr:

     pom = POM.load("pom.xml")
     puts pom.dependencies(:scopes=>"compile").inspect

it won't print anything, unless I explicitly specify the scope in the 
POM file.
Any reason why that is so? Could it not very easily be fixed by adding this:

{ :scope=>"compile" }.merge(hash)

to the method pom_to_hash in pom.rb file, like it is already done for 
the type, if none was specified?

Anything speaking against that?

Cheers, Ingo =;->

Re: Default Scope of Dependencies

Posted by Peter Donald <pe...@realityforge.org>.
Change applied to trunk Buildr.

Thanks!


On Fri, Aug 2, 2013 at 10:48 PM, Ingo Schmidt <an...@der-ingo.de> wrote:

> Hi all,
>
> I have a question about the default scope of dependencies in buildr.
> According to http://maven.apache.org/**guides/introduction/**
> introduction-to-dependency-**mechanism.html<http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html>the compile scope is the default, if no scope is specified.
> However, if I run this code in buildr:
>
>     pom = POM.load("pom.xml")
>     puts pom.dependencies(:scopes=>"**compile").inspect
>
> it won't print anything, unless I explicitly specify the scope in the POM
> file.
> Any reason why that is so? Could it not very easily be fixed by adding
> this:
>
> { :scope=>"compile" }.merge(hash)
>
> to the method pom_to_hash in pom.rb file, like it is already done for the
> type, if none was specified?
>
> Anything speaking against that?
>
> Cheers, Ingo =;->
>



-- 
Cheers,

Peter Donald

Re: Default Scope of Dependencies

Posted by Alex Boisvert <al...@gmail.com>.
Makes sense to me.  Will fix when I get to back to a computer.

On Friday, August 2, 2013, Ingo Schmidt wrote:

> Hi all,
>
> I have a question about the default scope of dependencies in buildr.
> According to http://maven.apache.org/**guides/introduction/**
> introduction-to-dependency-**mechanism.html<http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html>the compile scope is the default, if no scope is specified.
> However, if I run this code in buildr:
>
>     pom = POM.load("pom.xml")
>     puts pom.dependencies(:scopes=>"**compile").inspect
>
> it won't print anything, unless I explicitly specify the scope in the POM
> file.
> Any reason why that is so? Could it not very easily be fixed by adding
> this:
>
> { :scope=>"compile" }.merge(hash)
>
> to the method pom_to_hash in pom.rb file, like it is already done for the
> type, if none was specified?
>
> Anything speaking against that?
>
> Cheers, Ingo =;->
>