dependencies.yml and iBiblio behind basic auth

233 views
Skip to first unread message

Adam Miller

unread,
May 3, 2011, 11:03:49 AM5/3/11
to play-fr...@googlegroups.com
Whats the syntax for the "HTTP authentication credentials" http://ant.apache.org/ivy/history/latest-milestone/settings/credentials.html
in the dependencies.yml ?

I have tried the http://user:password@maven-repo but it doesn't work

Best Regards Adam

Pascal Voitot Dev

unread,
May 3, 2011, 1:52:58 PM5/3/11
to play-fr...@googlegroups.com
It's not a play issue but a Ivy issue IMO.
Play uses the IBiblioResolver class which doesn't provide anything for credentials. According to the very light Ivy doc on this aspect, this class uses ivysettings.xml and the <credential> tag... mayve you could try it...

ibiblio should also be public repos so that's also why there are no credentials for them (you are trying to deploy your artifact into a repo)

regards
Pascal

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Adam Miller

unread,
May 4, 2011, 2:59:35 AM5/4/11
to play-fr...@googlegroups.com

Yes, but how should i access an maven repo with basic auth from dependencies.yml. I believe it's not unusual to have an internal maven repo like nexus thats protected. Should i switch back to the play maven plugin, or is there a solution to this problem that i don't get?


Best Regards Λdam

2011/5/3 Pascal Voitot Dev <pascal.v...@gmail.com>

Pascal Voitot Dev

unread,
May 4, 2011, 3:02:21 AM5/4/11
to play-fr...@googlegroups.com
On Wed, May 4, 2011 at 8:59 AM, Adam Miller <adam.hg...@gmail.com> wrote:

Yes, but how should i access an maven repo with basic auth from dependencies.yml. I believe it's not unusual to have an internal maven repo like nexus thats protected. Should i switch back to the play maven plugin, or is there a solution to this problem that i don't get?



I understand your problem since I use local nexus with protection also :)
I don't know Ivy much but isn't it possible to put the credentials in the ivysettings.xml in the ~/.ivy directory or something like that?

the Ivy doc is quite light about this point :)

Pascal
 

Adam Miller

unread,
May 4, 2011, 4:27:55 AM5/4/11
to play-fr...@googlegroups.com
I tried this to se if it reads the ivysettings.xml, but it don't care about the new cache attribute.


2011/5/4 Pascal Voitot Dev <pascal.v...@gmail.com>

Adam Miller

unread,
May 4, 2011, 5:08:01 AM5/4/11
to play-fr...@googlegroups.com
quick fix for now, i copy all dep to project lib and do a local dependency in dependencies.yml. It sucks but work.

Best Regards Λdam

2011/5/4 Adam Miller <adam.hg...@gmail.com>

Pascal Voitot Dev

unread,
May 4, 2011, 5:10:37 AM5/4/11
to play-fr...@googlegroups.com
yes nasty :(
I really wonder how Ivy embedded classes work with Ivy settings... even the credential config in XML is not provided on their site :(

2011/5/4 Adam Miller <adam.hg...@gmail.com>

Adam Miller

unread,
May 4, 2011, 6:35:04 AM5/4/11
to play-fr...@googlegroups.com

Found this, supose we could use it in https://github.com/playframework/play/blob/master/framework/src/play/deps/DependenciesManager.java


http://www.docjar.org/docs/api/org/apache/ivy/Ivy.html


Here is one typical usage:

Ivy ivy = Ivy.newInstance();

ivy.configure(new URL("ivysettings.xml"));


It should use ~/.ivy2/ivysettings.xml as default.

Best Regards Λdam

Pascal Voitot Dev

unread,
May 4, 2011, 6:42:30 AM5/4/11
to play-fr...@googlegroups.com
The problem is that apparently play code create a IvySettings also.
I thought this IvySettings class used ivysettings.xml by default and enriched it with local config.
But it means by default, it uses internal default parameters :)

Guillaume, if you read this mail, what do you think about this issue? (in order to use nexus for ex, it's quite important IMO)

regards
Pascal


2011/5/4 Adam Miller <adam.hg...@gmail.com>

Guillaume Bort

unread,
May 4, 2011, 7:29:01 AM5/4/11
to play-fr...@googlegroups.com
If is there a way to reuse the existing ivysettings.xml as base, I'm
ok with that.

2011/5/4 Pascal Voitot Dev <pascal.v...@gmail.com>:

--
Guillaume Bort, http://guillaume.bort.fr

Adam Miller

unread,
May 4, 2011, 11:31:22 AM5/4/11
to play-fr...@googlegroups.com

Hi! I have done a solution that works in DependenciesManager.java that reads a .ivy2/ivysettings.xml if exists.

And it would be nice to be able to configure ivy through for example application.conf, properties that could be handy is ex. "ivy.checksums" and configurable path to ivysettings.xml

But you don't have access to Play.configuration in DependenciesManager and i no nothing about the conventions in play so i have no solution to that. 


Best Regards Λdam


2011/5/4 Guillaume Bort <guillau...@gmail.com>

Pascal Voitot Dev

unread,
May 4, 2011, 11:49:39 AM5/4/11
to play-fr...@googlegroups.com


2011/5/4 Adam Miller <adam.hg...@gmail.com>

Hi! I have done a solution that works in DependenciesManager.java that reads a .ivy2/ivysettings.xml if exists.

And it would be nice to be able to configure ivy through for example application.conf, properties that could be handy is ex. "ivy.checksums" and configurable path to ivysettings.xml

But you don't have access to Play.configuration in DependenciesManager and i no nothing about the conventions in play so i have no solution to that. 



great!
And is it possible to mix the ivysettings.xml with the configuration set in SettingsParser class?

I think it's not difficult to read play config from DependenciesManager.
Look at the class Play and function public static void readConfiguration()...
I think it's not difficult to read the config and use it...

Pascal
 

Adam Miller

unread,
May 5, 2011, 4:24:42 AM5/5/11
to play-fr...@googlegroups.com
2011/5/4 Pascal Voitot Dev <pascal.v...@gmail.com>
2011/5/4 Adam Miller <adam.hg...@gmail.com>

Hi! I have done a solution that works in DependenciesManager.java that reads a .ivy2/ivysettings.xml if exists.

And it would be nice to be able to configure ivy through for example application.conf, properties that could be handy is ex. "ivy.checksums" and configurable path to ivysettings.xml

But you don't have access to Play.configuration in DependenciesManager and i no nothing about the conventions in play so i have no solution to that. 



great!
And is it possible to mix the ivysettings.xml with the configuration set in SettingsParser class?

Yes i think thats maybe a better solution than using application.conf. I'll have a look.


I think it's not difficult to read play config from DependenciesManager.
Look at the class Play and function public static void readConfiguration()...
I think it's not difficult to read the config and use it...

Then we don't need this.

Adam Miller

unread,
May 6, 2011, 7:56:31 AM5/6/11
to play-fr...@googlegroups.com
Created a ticket 807 for this.

2011/5/5 Adam Miller <adam.hg...@gmail.com>

Λdam Miller

unread,
Aug 24, 2011, 8:00:19 AM8/24/11
to play-fr...@googlegroups.com
Sweet! I verified it now works to access basic auth iBiblio dependencies with play-1.2.3.

Eg. access nexus behind basic auth, configure ivysettings.xml
~/.ivy2/ivysettings.xml

<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
  <credentials host="nexus.hostname" realm="Sonatype Nexus Repository Manager" username="xxxx" passwd="yyyy"/>
</ivysettings>

Great work!

Best Regards Λdam


2011/5/6 Adam Miller <adam.hg...@gmail.com>

Pascal Voitot Dev

unread,
Aug 24, 2011, 8:24:39 AM8/24/11
to play-fr...@googlegroups.com
great :D

Pascal

2011/8/24 Λdam Miller <adam.hg...@gmail.com>
Reply all
Reply to author
Forward
0 new messages