You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Khristian <de...@gmail.com> on 2012/01/10 20:07:14 UTC

Problems specifying repositories

Hi,
I'm trying to start a small project to test buildr, but I need to add
some repositories to the remote repositories list. Both the local and
remote repositories work with maven.
I've added my repositories like this:

repositories.remote <<
URI.parse("user:pass@http://local.repo/nexus/content/groups/public")
repositories.local = 'f:\buildr-repo'

As per the instructions on buildr's manual, I've tried adding the
above lines to the "%userprofile%\.buildr\settings.yaml" (I'm on
Windows), "%userprofile%\.buildr\buildr.rb" and
"project_folder\buildr.rb" files.

Now, when I invoke "buildr --generate pom.xml", it tries to download
the project's dependencies from "http://www.ibiblio.org/maven2/". What
am I doing wrong?

Thanks,

-- 
Khristian Alexander Schönrock

Re: Problems specifying repositories

Posted by Khristian Alexander Schönrock <de...@gmail.com>.
Many thanks for the help!
As a feature suggestion, buildr could have some scheme to protect 
passwords in configuration files like maven does, with a master password 
to encrypt passwords used in the settings.xml file, though I do not know 
how it works under the hood.

Em 10/01/2012 18:44, Alex Boisvert escreveu:
> On Tue, Jan 10, 2012 at 2:45 PM, Khristian<de...@gmail.com>  wrote:
>
>> Damn, I facepalmed hard now!
>> Yes, it works when properly specified, too. :D
>>
> Nice :)
>
>
>> Now that this has been cleared, I have another question about
>> repositories and artifacts: is there a way to keep buildr from
>> spamming the console with the complete URL (with user and password)
>> when downloading artifacts?
>>
> Not without patching the source, I'm afraid.   It's probably a very
> localized change if you want to take a stab at it... look into
> lib/buildr/core/transports.rb.
>
> alex
>

Re: Problems specifying repositories

Posted by Alex Boisvert <al...@gmail.com>.
On Tue, Jan 10, 2012 at 2:45 PM, Khristian <de...@gmail.com> wrote:

> Damn, I facepalmed hard now!
> Yes, it works when properly specified, too. :D
>

Nice :)


> Now that this has been cleared, I have another question about
> repositories and artifacts: is there a way to keep buildr from
> spamming the console with the complete URL (with user and password)
> when downloading artifacts?
>

Not without patching the source, I'm afraid.   It's probably a very
localized change if you want to take a stab at it... look into
lib/buildr/core/transports.rb.

alex

Re: Problems specifying repositories

Posted by Khristian <de...@gmail.com>.
Damn, I facepalmed hard now!
Yes, it works when properly specified, too. :D

Now that this has been cleared, I have another question about
repositories and artifacts: is there a way to keep buildr from
spamming the console with the complete URL (with user and password)
when downloading artifacts?

On Tue, Jan 10, 2012 at 5:30 PM, Alex Boisvert <al...@gmail.com> wrote:
> Can you try this instead,
>
> repositories.remote << "http://user:pass@local.repo
> /nexus/content/groups/public"
>
> (note the user + password location in the URL)
>
> alex
>
>
> On Tue, Jan 10, 2012 at 2:25 PM, Khristian <de...@gmail.com> wrote:
>
>> I forgot to mention, I'm using buildr with JRuby 1.6.5.1. I also added
>> the test as you said, and it's really loading the file in my home
>> directory.
>> Now the error seems to be in my authenticated repository URLs: if I
>> let buildr only try downloading the artifact from ibiblio, it fails
>> with the "Failed to download artifact..." message, as expected. When I
>> add the private repositories lines, it fails differently:
>>
>> f:\teste-ear>buildr compile --trace
>> I'm loading! /o/
>> (in F:/teste-ear, development)
>> ** Invoke
>> f:/.m2/repo-temp/org/test/Test/1.0.6.0-SNAPSHOT/Test-1.0.6.0-SNAPSHOT.pom
>> (first_time)
>> ** Execute
>> f:/.m2/repo-temp/org/test/Test/1.0.6.0-SNAPSHOT/Test-1.0.6.0-SNAPSHOT.pom
>> Downloading org.test:Test:pom:1.0.6.0-SNAPSHOT
>> Downloading org.test:Test:pom:1.0.6.0-SNAPSHOT
>> Buildr aborted!
>> NoMethodError : undefined method `[]' for nil:NilClass
>>
>> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:428:in
>> `download'
>> org/jruby/RubyArray.java:1612:in `each'
>>
>> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:428:in
>> `download'
>>
>> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:356:in
>> `initialize'
>>
>>
>>
>> On Tue, Jan 10, 2012 at 5:17 PM, Alex Boisvert <al...@gmail.com>
>> wrote:
>> > Oh, if you're using something like cygwin on Windows, it's possible that
>> > your HOME directory may be set to a different location, e.g.
>> >  c:\cygwin\home\%name%.
>> >
>> > alex
>> >
>> > On Tue, Jan 10, 2012 at 2:15 PM, Alex Boisvert <alex.boisvert@gmail.com
>> >wrote:
>> >
>> >> You can check if your "%userprofile%\.buildr\buildr.rb" profile is
>> picked
>> >> up by adding something like:
>> >>
>> >> puts "i'm loading!!!"
>> >>
>> >> in it.    Secondly, I think "http://www.ibiblio.org/maven2/" is always
>> >> added by default to new projects.  Additional repositories defined in
>> your
>> >> profile should be used as well.
>> >>
>> >> alex
>> >>
>> >>
>> >> On Tue, Jan 10, 2012 at 2:07 PM, Khristian <de...@gmail.com> wrote:
>> >>
>> >>> Hi,
>> >>> I'm trying to start a small project to test buildr, but I need to add
>> >>> some repositories to the remote repositories list. Both the local and
>> >>> remote repositories work with maven.
>> >>> I've added my repositories like this:
>> >>>
>> >>> repositories.remote <<
>> >>> URI.parse("user:pass@http://local.repo/nexus/content/groups/public")
>> >>> repositories.local = 'f:\buildr-repo'
>> >>>
>> >>> As per the instructions on buildr's manual, I've tried adding the
>> >>> above lines to the "%userprofile%\.buildr\settings.yaml" (I'm on
>> >>> Windows), "%userprofile%\.buildr\buildr.rb" and
>> >>> "project_folder\buildr.rb" files.
>> >>>
>> >>> Now, when I invoke "buildr --generate pom.xml", it tries to download
>> >>> the project's dependencies from "http://www.ibiblio.org/maven2/". What
>> >>> am I doing wrong?
>> >>>
>> >>> Thanks,
>> >>>
>> >>> --
>> >>> Khristian Alexander Schönrock
>> >>>
>> >>
>> >>
>>
>>
>>
>> --
>> Khristian Alexander Schönrock
>>



-- 
Khristian Alexander Schönrock

Re: Problems specifying repositories

Posted by Alex Boisvert <al...@gmail.com>.
Can you try this instead,

repositories.remote << "http://user:pass@local.repo
/nexus/content/groups/public"

(note the user + password location in the URL)

alex


On Tue, Jan 10, 2012 at 2:25 PM, Khristian <de...@gmail.com> wrote:

> I forgot to mention, I'm using buildr with JRuby 1.6.5.1. I also added
> the test as you said, and it's really loading the file in my home
> directory.
> Now the error seems to be in my authenticated repository URLs: if I
> let buildr only try downloading the artifact from ibiblio, it fails
> with the "Failed to download artifact..." message, as expected. When I
> add the private repositories lines, it fails differently:
>
> f:\teste-ear>buildr compile --trace
> I'm loading! /o/
> (in F:/teste-ear, development)
> ** Invoke
> f:/.m2/repo-temp/org/test/Test/1.0.6.0-SNAPSHOT/Test-1.0.6.0-SNAPSHOT.pom
> (first_time)
> ** Execute
> f:/.m2/repo-temp/org/test/Test/1.0.6.0-SNAPSHOT/Test-1.0.6.0-SNAPSHOT.pom
> Downloading org.test:Test:pom:1.0.6.0-SNAPSHOT
> Downloading org.test:Test:pom:1.0.6.0-SNAPSHOT
> Buildr aborted!
> NoMethodError : undefined method `[]' for nil:NilClass
>
> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:428:in
> `download'
> org/jruby/RubyArray.java:1612:in `each'
>
> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:428:in
> `download'
>
> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:356:in
> `initialize'
>
>
>
> On Tue, Jan 10, 2012 at 5:17 PM, Alex Boisvert <al...@gmail.com>
> wrote:
> > Oh, if you're using something like cygwin on Windows, it's possible that
> > your HOME directory may be set to a different location, e.g.
> >  c:\cygwin\home\%name%.
> >
> > alex
> >
> > On Tue, Jan 10, 2012 at 2:15 PM, Alex Boisvert <alex.boisvert@gmail.com
> >wrote:
> >
> >> You can check if your "%userprofile%\.buildr\buildr.rb" profile is
> picked
> >> up by adding something like:
> >>
> >> puts "i'm loading!!!"
> >>
> >> in it.    Secondly, I think "http://www.ibiblio.org/maven2/" is always
> >> added by default to new projects.  Additional repositories defined in
> your
> >> profile should be used as well.
> >>
> >> alex
> >>
> >>
> >> On Tue, Jan 10, 2012 at 2:07 PM, Khristian <de...@gmail.com> wrote:
> >>
> >>> Hi,
> >>> I'm trying to start a small project to test buildr, but I need to add
> >>> some repositories to the remote repositories list. Both the local and
> >>> remote repositories work with maven.
> >>> I've added my repositories like this:
> >>>
> >>> repositories.remote <<
> >>> URI.parse("user:pass@http://local.repo/nexus/content/groups/public")
> >>> repositories.local = 'f:\buildr-repo'
> >>>
> >>> As per the instructions on buildr's manual, I've tried adding the
> >>> above lines to the "%userprofile%\.buildr\settings.yaml" (I'm on
> >>> Windows), "%userprofile%\.buildr\buildr.rb" and
> >>> "project_folder\buildr.rb" files.
> >>>
> >>> Now, when I invoke "buildr --generate pom.xml", it tries to download
> >>> the project's dependencies from "http://www.ibiblio.org/maven2/". What
> >>> am I doing wrong?
> >>>
> >>> Thanks,
> >>>
> >>> --
> >>> Khristian Alexander Schönrock
> >>>
> >>
> >>
>
>
>
> --
> Khristian Alexander Schönrock
>

Re: Problems specifying repositories

Posted by Khristian <de...@gmail.com>.
I forgot to mention, I'm using buildr with JRuby 1.6.5.1. I also added
the test as you said, and it's really loading the file in my home
directory.
Now the error seems to be in my authenticated repository URLs: if I
let buildr only try downloading the artifact from ibiblio, it fails
with the "Failed to download artifact..." message, as expected. When I
add the private repositories lines, it fails differently:

f:\teste-ear>buildr compile --trace
I'm loading! /o/
(in F:/teste-ear, development)
** Invoke f:/.m2/repo-temp/org/test/Test/1.0.6.0-SNAPSHOT/Test-1.0.6.0-SNAPSHOT.pom
(first_time)
** Execute f:/.m2/repo-temp/org/test/Test/1.0.6.0-SNAPSHOT/Test-1.0.6.0-SNAPSHOT.pom
Downloading org.test:Test:pom:1.0.6.0-SNAPSHOT
Downloading org.test:Test:pom:1.0.6.0-SNAPSHOT
Buildr aborted!
NoMethodError : undefined method `[]' for nil:NilClass
c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:428:in
`download'
org/jruby/RubyArray.java:1612:in `each'
c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:428:in
`download'
c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:356:in
`initialize'



On Tue, Jan 10, 2012 at 5:17 PM, Alex Boisvert <al...@gmail.com> wrote:
> Oh, if you're using something like cygwin on Windows, it's possible that
> your HOME directory may be set to a different location, e.g.
>  c:\cygwin\home\%name%.
>
> alex
>
> On Tue, Jan 10, 2012 at 2:15 PM, Alex Boisvert <al...@gmail.com>wrote:
>
>> You can check if your "%userprofile%\.buildr\buildr.rb" profile is picked
>> up by adding something like:
>>
>> puts "i'm loading!!!"
>>
>> in it.    Secondly, I think "http://www.ibiblio.org/maven2/" is always
>> added by default to new projects.  Additional repositories defined in your
>> profile should be used as well.
>>
>> alex
>>
>>
>> On Tue, Jan 10, 2012 at 2:07 PM, Khristian <de...@gmail.com> wrote:
>>
>>> Hi,
>>> I'm trying to start a small project to test buildr, but I need to add
>>> some repositories to the remote repositories list. Both the local and
>>> remote repositories work with maven.
>>> I've added my repositories like this:
>>>
>>> repositories.remote <<
>>> URI.parse("user:pass@http://local.repo/nexus/content/groups/public")
>>> repositories.local = 'f:\buildr-repo'
>>>
>>> As per the instructions on buildr's manual, I've tried adding the
>>> above lines to the "%userprofile%\.buildr\settings.yaml" (I'm on
>>> Windows), "%userprofile%\.buildr\buildr.rb" and
>>> "project_folder\buildr.rb" files.
>>>
>>> Now, when I invoke "buildr --generate pom.xml", it tries to download
>>> the project's dependencies from "http://www.ibiblio.org/maven2/". What
>>> am I doing wrong?
>>>
>>> Thanks,
>>>
>>> --
>>> Khristian Alexander Schönrock
>>>
>>
>>



-- 
Khristian Alexander Schönrock

Re: Problems specifying repositories

Posted by Alex Boisvert <al...@gmail.com>.
Oh, if you're using something like cygwin on Windows, it's possible that
your HOME directory may be set to a different location, e.g.
 c:\cygwin\home\%name%.

alex

On Tue, Jan 10, 2012 at 2:15 PM, Alex Boisvert <al...@gmail.com>wrote:

> You can check if your "%userprofile%\.buildr\buildr.rb" profile is picked
> up by adding something like:
>
> puts "i'm loading!!!"
>
> in it.    Secondly, I think "http://www.ibiblio.org/maven2/" is always
> added by default to new projects.  Additional repositories defined in your
> profile should be used as well.
>
> alex
>
>
> On Tue, Jan 10, 2012 at 2:07 PM, Khristian <de...@gmail.com> wrote:
>
>> Hi,
>> I'm trying to start a small project to test buildr, but I need to add
>> some repositories to the remote repositories list. Both the local and
>> remote repositories work with maven.
>> I've added my repositories like this:
>>
>> repositories.remote <<
>> URI.parse("user:pass@http://local.repo/nexus/content/groups/public")
>> repositories.local = 'f:\buildr-repo'
>>
>> As per the instructions on buildr's manual, I've tried adding the
>> above lines to the "%userprofile%\.buildr\settings.yaml" (I'm on
>> Windows), "%userprofile%\.buildr\buildr.rb" and
>> "project_folder\buildr.rb" files.
>>
>> Now, when I invoke "buildr --generate pom.xml", it tries to download
>> the project's dependencies from "http://www.ibiblio.org/maven2/". What
>> am I doing wrong?
>>
>> Thanks,
>>
>> --
>> Khristian Alexander Schönrock
>>
>
>

Re: Problems specifying repositories

Posted by Alex Boisvert <al...@gmail.com>.
You can check if your "%userprofile%\.buildr\buildr.rb" profile is picked
up by adding something like:

puts "i'm loading!!!"

in it.    Secondly, I think "http://www.ibiblio.org/maven2/" is always
added by default to new projects.  Additional repositories defined in your
profile should be used as well.

alex


On Tue, Jan 10, 2012 at 2:07 PM, Khristian <de...@gmail.com> wrote:

> Hi,
> I'm trying to start a small project to test buildr, but I need to add
> some repositories to the remote repositories list. Both the local and
> remote repositories work with maven.
> I've added my repositories like this:
>
> repositories.remote <<
> URI.parse("user:pass@http://local.repo/nexus/content/groups/public")
> repositories.local = 'f:\buildr-repo'
>
> As per the instructions on buildr's manual, I've tried adding the
> above lines to the "%userprofile%\.buildr\settings.yaml" (I'm on
> Windows), "%userprofile%\.buildr\buildr.rb" and
> "project_folder\buildr.rb" files.
>
> Now, when I invoke "buildr --generate pom.xml", it tries to download
> the project's dependencies from "http://www.ibiblio.org/maven2/". What
> am I doing wrong?
>
> Thanks,
>
> --
> Khristian Alexander Schönrock
>