protected repositories

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

protected repositories

Marko Bauhardt-3
Hi all,
i have a question how i can use a protected maven1 repository.
all dependencies are hosted on our internal maven repo which is  
running on an apache web server and is protected with the basic  
authentication.

So, i have add the urlResolver to the classpathResolvers

---
def urlResolver = new URLResolver()
urlResolver.addArtifactPattern("http://USERNAME:PASSWORD@REPO/ 
[organisation]/[ext]s/[artifact]-[revision].[ext]")

dependencies {

   addMavenRepo()
   classpathResolvers.add(urlResolver)

...

}
---


In the console output this repository is printed out with the correct  
url, but the no dependencies are downloaded.

can anyone help?

thanks
marko



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

hans_d
Administrator
Hi Marko,

On Jun 30, 2008, at 11:27 PM, Marko Bauhardt wrote:

> Hi all,
> i have a question how i can use a protected maven1 repository.
> all dependencies are hosted on our internal maven repo which is  
> running on an apache web server and is protected with the basic  
> authentication.
>
> So, i have add the urlResolver to the classpathResolvers
>
> ---
> def urlResolver = new URLResolver()
> urlResolver.addArtifactPattern("http://USERNAME:PASSWORD@REPO/ 
> [organisation]/[ext]s/[artifact]-[revision].[ext]")
>
> dependencies {
>
>   addMavenRepo()
>   classpathResolvers.add(urlResolver)
>
> ...
>
> }
> ---
>
>
> In the console output this repository is printed out with the  
> correct url, but the no dependencies are downloaded.

The URLResolver does not accept such a notation. Unfortunately does  
it provide a user and userPassword property for basic authentication.  
I think you have to use the vfs resolvers. This is an optional jar of  
Ivy. Gradle has currently a classloader bug, therefore you can't use  
Ivy's optional jars at the moment. As you are working on a Mac, that  
the work around does not work for you. This bug will be fixed tonight  
or tomorrow morning. Than I will go more into detail how to work with  
vfs.

- Hans

>
> can anyone help?
>
> thanks
> marko
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

Marko Bauhardt-3

On Jul 1, 2008, at 5:48 PM, Hans Dockter wrote:

> Hi Marko,

Hi Hans,
>
>
> The URLResolver does not accept such a notation.

ah ok.

> Unfortunately does it provide a user and userPassword property for  
> basic authentication. I think you have to use the vfs resolvers.  
> This is an optional jar of Ivy. Gradle has currently a classloader  
> bug, therefore you can't use Ivy's optional jars at the moment. As  
> you are working on a Mac, that the work around does not work for  
> you. This bug will be fixed tonight or tomorrow morning. Than I will  
> go more into detail how to work with vfs.

ok no problem. write an email to the mailinglist if this bug is fixed.

thanks
marko


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

Xavier Hanin
In reply to this post by hans_d
On Tue, Jul 1, 2008 at 5:48 PM, Hans Dockter <[hidden email]> wrote:
Hi Marko,


On Jun 30, 2008, at 11:27 PM, Marko Bauhardt wrote:

Hi all,
i have a question how i can use a protected maven1 repository.
all dependencies are hosted on our internal maven repo which is running on an apache web server and is protected with the basic authentication.

So, i have add the urlResolver to the classpathResolvers

---
def urlResolver = new URLResolver()
urlResolver.addArtifactPattern("http://USERNAME:PASSWORD@REPO/[organisation]/[ext]s/[artifact]-[revision].[ext]")

dependencies {

 addMavenRepo()
 classpathResolvers.add(urlResolver)

...

}
---


In the console output this repository is printed out with the correct url, but the no dependencies are downloaded.

The URLResolver does not accept such a notation. Unfortunately does it provide a user and userPassword property for basic authentication. I think you have to use the vfs resolvers.
That's a place where Ivy is not shining, but there's another option: use Ivy CredentialsStore. sg like that should be working:
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("My private Repo Realm", "repohost", "username", "password");

HTH,

Xavier

 
This is an optional jar of Ivy. Gradle has currently a classloader bug, therefore you can't use Ivy's optional jars at the moment. As you are working on a Mac, that the work around does not work for you. This bug will be fixed tonight or tomorrow morning. Than I will go more into detail how to work with vfs.

- Hans



can anyone help?

thanks
marko



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



--
Hans Dockter
Gradle Project lead
http://www.gradle.org






---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/
Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

Marko Bauhardt-3

On Jul 2, 2008, at 10:26 AM, Xavier Hanin wrote:

Hi Xavier,

> That's a place where Ivy is not shining, but there's another option:  
> use Ivy CredentialsStore. sg like that should be working:
> org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("My  
> private Repo Realm", "repohost", "username", "password");
>


thanks a lot for the hint. i have tried this and it doesnt work. but  
i'm a newbie on ivy.  i have to read more ivy documentation (e.g.  
CredentialStore) to get more understanding.


Thanks for help
marko


> HTH,
>
> Xavier


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

Xavier Hanin
On Wed, Jul 2, 2008 at 12:17 PM, Marko Bauhardt <[hidden email]> wrote:

On Jul 2, 2008, at 10:26 AM, Xavier Hanin wrote:

Hi Xavier,


That's a place where Ivy is not shining, but there's another option: use Ivy CredentialsStore. sg like that should be working:
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("My private Repo Realm", "repohost", "username", "password");



thanks a lot for the hint. i have tried this and it doesnt work. but i'm a newbie on ivy.  i have to read more ivy documentation (e.g. CredentialStore) to get more understanding.
Actually there isn't much documentation on this class, since until recently Ivy wasn't meant to be used as an API. But I'm surprised it doesn't work,  that's what Ivy use internally and it works AFAIK. I guess you can activate Ivy debug logs, you should see logs about "installing org.apache.ivy.util.url.IvyAuthenticator" and when accessing the repo "authentication: k='...' c='...'" which can help setting the right values for realm and host.

Xavier




Thanks for help
marko


HTH,

Xavier


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/
Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

Marko Bauhardt-3

On Jul 2, 2008, at 12:33 PM, Xavier Hanin wrote:

> Actually there isn't much documentation on this class, since until  
> recently Ivy wasn't meant to be used as an API. But I'm surprised it  
> doesn't work,  that's what Ivy use internally and it works AFAIK. I  
> guess you can activate Ivy debug logs, you should see logs about  
> "installing org.apache.ivy.util.url.IvyAuthenticator" and when  
> accessing the repo "authentication: k='...' c='...'" which can help  
> setting the right values for realm and host.
>

i execute gradle in depDebug mode: "gradle -j compile"

and i get the following debug message:

authentication: k='MY_REALM_NAME@MY_REPO' c='null'
CLIENT ERROR: Unauthorized url=http://MY_REPO/PATH_TO_MY_JAR

what means 'c'? credential? but i have set the password you described:
org
.apache
.ivy
.util.url.CredentialsStore.INSTANCE.addCredentials("MY_REALM_NAME", "http://HOST 
_NAME", "USER", "PASSWORD");

marko




> Xavier
>
>
>
>
> Thanks for help
> marko
>
>
> HTH,
>
> Xavier
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>
>
>
> --
> Xavier Hanin - Independent Java Consultant
> http://xhab.blogspot.com/
> http://ant.apache.org/ivy/
> http://www.xoocode.org/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

Xavier Hanin
On Wed, Jul 2, 2008 at 1:47 PM, Marko Bauhardt <[hidden email]> wrote:

On Jul 2, 2008, at 12:33 PM, Xavier Hanin wrote:

Actually there isn't much documentation on this class, since until recently Ivy wasn't meant to be used as an API. But I'm surprised it doesn't work,  that's what Ivy use internally and it works AFAIK. I guess you can activate Ivy debug logs, you should see logs about "installing org.apache.ivy.util.url.IvyAuthenticator" and when accessing the repo "authentication: k='...' c='...'" which can help setting the right values for realm and host.


i execute gradle in depDebug mode: "gradle -j compile"

and i get the following debug message:

authentication: k='MY_REALM_NAME@MY_REPO' c='null'
CLIENT ERROR: Unauthorized url=http://MY_REPO/PATH_TO_MY_JAR

what means 'c'? credential?
yes
but i have set the password you described:
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("MY_REALM_NAME", "http://HOST_NAME", "USER", "PASSWORD");
try without the http:// for the host name

Xavier


marko





Xavier




Thanks for help
marko


HTH,

Xavier


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

 http://xircles.codehaus.org/manage_email





--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/
Reply | Threaded
Open this post in threaded view
|

Re: protected repositories

Marko Bauhardt-3

On Jul 2, 2008, at 2:02 PM, Xavier Hanin wrote:

but i have set the password you described:
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("MY_REALM_NAME", "http://HOST_NAME", "USER", "PASSWORD");



try without the http:// for the host name

Oh wow. thanks  a lot. it works!! 

btw: it works only if the realm name (first parameter) is exactly the same realm name which is configured on our apache server. 

thanks a lot
now i can use gradle in our projects

marko