Can not resolve artifacts with dynamic revisions from Ivy repository

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

Can not resolve artifacts with dynamic revisions from Ivy repository

Milan Papzilla
Hello,

I can not resolve artifacts with dynamic revision number from a Ivy repository.
According to GRADLE-1789 this should work but when I try to resolve e.g

dependencies {
    testCompile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.8.+', configuration:'default'
}

version: '1.8.+' fails while version: '1.8.3' is resolved correctly.
Also resolving against mavenCentral()  is working correctly.

But whenever I use a dynamic version number with a Ivy repository it ends up with:

org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':testCompile'.
[org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:51)
[org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.rethrowFailure(DefaultResolvedConfiguration.java:36)
[org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver$1.rethrowFailure(SelfResolvingDependencyResolver.java:81)
....
Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException: Could not find any version that matches group:commons-beanutils, module:commons-beanutils, version:1.8.+.

any suggestions ?



Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Robert Fischer
I was under the impression that Gradle did not support dynamic
revisions. It'd be really nice if it did!

~~ Robert.


On Wed, May 2, 2012 at 8:53 AM, Milan Papzilla <[hidden email]> wrote:

> Hello,
>
> I can not resolve artifacts with dynamic revision number from a Ivy
> repository.
> According to GRADLE-1789 this should work but when I try to resolve e.g
>
> dependencies {
>    testCompile group: 'commons-beanutils', name: 'commons-beanutils',
> version: '1.8.+', configuration:'default'
> }
>
> version: '1.8.+' fails while version: '1.8.3' is resolved correctly.
> Also resolving against mavenCentral()  is working correctly.
>
> But whenever I use a dynamic version number with a Ivy repository it ends up
> with:
>
> org.gradle.api.artifacts.ResolveException: Could not resolve all
> dependencies for configuration ':testCompile'.
> [org.gradle.BuildExceptionReporter]     at
> org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:51)
> [org.gradle.BuildExceptionReporter]     at
> org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.rethrowFailure(DefaultResolvedConfiguration.java:36)
> [org.gradle.BuildExceptionReporter]     at
> org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver$1.rethrowFailure(SelfResolvingDependencyResolver.java:81)
> ....
> Caused by:
> org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException:
> Could not find any version that matches group:commons-beanutils,
> module:commons-beanutils, version:1.8.+.
>
> any suggestions ?
>
>
>
>
>
> --
> View this message in context: http://gradle.1045684.n5.nabble.com/Can-not-resolve-artifacts-with-dynamic-revisions-from-Ivy-repository-tp5680421.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Milan Papzilla
But does http://issues.gradle.org/browse/GRADLE-1789 not mean that this is fixed since
1.0-milestone-5 ??
I am confused . I don't know what to do about it .
Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Peter Niederwieser
In reply to this post by Robert Fischer
Robert Fischer wrote
I was under the impression that Gradle did not support dynamic
revisions. It'd be really nice if it did!
Dynamic revisions have always been supported (modulo some bugs). Just don't expect too much from them; from my experience, they can cause significant problems both with Ivy and Maven (performance penalty, semantics). For me and others that's reason enough not to use them. Chances are that if Spring and Hibernate get along without them, you will too.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Twitter: @pniederw
Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Robert Fischer
Is there a syntax for them different from normal?

foo:bar:[1.2.3,) doesn't work as of the last time I tried it. The OP
states that foo:bar:1+ doesn't work.

~~ Robert.


On Wed, May 2, 2012 at 2:09 PM, Peter Niederwieser <[hidden email]> wrote:

>
> Robert Fischer wrote
>>
>> I was under the impression that Gradle did not support dynamic
>> revisions. It'd be really nice if it did!
>>
>
> Dynamic revisions have always been supported (modulo some bugs). Just don't
> expect too much from them; from my experience, they can cause significant
> problems both with Ivy and Maven (performance penalty, semantics). For me
> and others that's reason enough not to use them. Chances are that if Spring
> and Hibernate get along without them, you will too.
>
> --
> Peter Niederwieser
> Principal Engineer, Gradleware
> http://gradleware.com
> Creator, Spock Framework
> http://spockframework.org
> Twitter: @pniederw
>
> --
> View this message in context: http://gradle.1045684.n5.nabble.com/Can-not-resolve-artifacts-with-dynamic-revisions-from-Ivy-repository-tp5680421p5681254.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Peter Niederwieser
Ivy and Maven have different syntax for version ranges. Also the semantics are different. Gradle currently doesn't abstract over this. This can become a problem when both Ivy and Maven repositories are used in the same build.

I've just tried to resolve "junit:junit-dep:[4.7,4.99]" from Maven Central, and it worked fine.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Twitter: @pniederw
Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Milan Papzilla
Yes I confirm that Maven Central works as expected and has no problems with dynamic revisions.
Had hope that the problem with Ivy is that I use Maven Central in buildscript closure to resolve io:commons-io
but this was not the case. I turned the Maven repository off and still it ends up with
Could not find any version that matches group:commons-beanutils, module:commons-beanutils, version:1.8.+.
Giving a explicit version number like 1.8.3 resolves correct .

I also agree that this should not be a k.o criterion not changing from ant/gant/ivy to gradle
but still I would like to know if this should be possible or not.
For the moment I resolve the dependencies with a gant script and set up gradle to use the users
ivy cache as the 'repository'.


~ Milan


Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Daz DeBoer-2
Dynamic versions such as 1.8.+ do work with ivy repositories. This functionality relies on directory listing by the repository to get the list of available revisions.
It's often useful to run the build with "--refresh-dependencies --info" to assist with understanding and rectifying dependency resolution issues.
Daz

On 4 May 2012 14:51, Milan Papzilla <[hidden email]> wrote:
Yes I confirm that Maven Central works as expected and has no problems with
dynamic revisions.
Had hope that the problem with Ivy is that I use Maven Central in
buildscript closure to resolve io:commons-io
but this was not the case. I turned the Maven repository off and still it
ends up with
Could not find any version that matches group:commons-beanutils,
module:commons-beanutils, version:1.8.+.
Giving a explicit version number like 1.8.3 resolves correct .

I also agree that this should not be a k.o criterion not changing from
ant/gant/ivy to gradle
but still I would like to know if this should be possible or not.
For the moment I resolve the dependencies with a gant script and set up
gradle to use the users
ivy cache as the 'repository'.


~ Milan




--
View this message in context: http://gradle.1045684.n5.nabble.com/Can-not-resolve-artifacts-with-dynamic-revisions-from-Ivy-repository-tp5680421p5684851.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

   http://xircles.codehaus.org/manage_email





--
Darrell (Daz) DeBoer
Principal Engineer, Gradleware 
http://www.gradleware.com


Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Milan Papzilla
This post was updated on .
I have tracked down my problem and it looks like the credentials for our repository
are not submitted when using dynamic version notation ( e.g 1.8.+) .
I assume that the same credentials are used that are defined in the repository closure

 
ivy {
       
        url "https:/COMAPNY/repository/trunk/ivyrepo"
        credentials {  
           username  'foo'
           password  'foopass'
        }
       
        layout 'pattern', {
            artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
            ivy "[organisation]/[module]/[revision]/[module]-ivy.xml"
        }
    }

For some reason the authentication does not work when using a dynamic revision.
Here the debug output where I see now credentials are used :
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] authentication: k='Subversion Repository@COMPANY c='null'

Is this a bug or do I miss something here ?

here the debug output concerning the authentication to the repo
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] using ivy to list all in https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] try to get credentials for: Subversion Repository@COMPANY
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] authentication: k='Subversion Repository@COMPANY c='null'
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] HTTP response status: 401 url=https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] CLIENT ERROR: Authorization Required url=COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] problem while listing resources in https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/ with ivy:
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]   java.io.IOException The HTTP response code for https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/ did not indicate a success. See log for more detail.
[DEBUG] [org.gradle.api.internal.artifacts.repositories.ExternalResourceResolver] Unable to list versions for commons-beanutils#commons-beanutils;1.8.+: pattern=https://COMPANY/repository/trunk/ivyrepo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] ivy: no ivy file nor artifact found for commons-beanutils#commons-beanutils;1.8.+
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DependencyResolverAdapter] Performed resolved of module 'commons-beanutils#commons-beanutils;1.8.+' in repository 'ivy': not found
Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Daz DeBoer-2
Hi Milan
It looks like you have found a bug in Gradle. We are using org.apache.ivy.util.url.ApacheURLLister to obtain a list of versions from a directory listing, and this code is not using the supplied credentials.

I've raised http://issues.gradle.org/browse/GRADLE-2318 for this issue.
Thanks for the report.
cheers
Daz

On 7 May 2012 08:32, Milan Papzilla <[hidden email]> wrote:
I have tracked down my problem and it looks like the credentials for our
repoitory
are not submitted when using dynamic version notation ( e.g 1.8.+) .
I assume that the same credentials are used that are defined in the
repository closure


ivy {

       url "https:/COMAPNY/repository/trunk/ivyrepo"
       credentials {
          username  'foo'
          password  'foopass'
       }

       layout 'pattern', {
           artifact
"[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
           ivy "[organisation]/[module]/[revision]/[module]-ivy.xml"
       }
   }

For some reason the authentication does not work when using a dynamic
revision.
Here the debug output where I see now credentials are used :
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]
authentication: k='Subversion Repository@COMPANY c='null'

Is this a bug or do I miss something here ?

here the debug output concerning the authentication to the repo
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]
using ivy to list all in
https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] try
to get credentials for: Subversion Repository@COMPANY
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]
authentication: k='Subversion Repository@COMPANY c='null'
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] HTTP
response status: 401
url=https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]
CLIENT ERROR: Authorization Required
url=COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]
problem while listing resources in
https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
with ivy:
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]
java.io.IOException The HTTP response code for
https://COMPANY/repository/trunk/ivyrepo/commons-beanutils/commons-beanutils/
did not indicate a success. See log for more detail.
[DEBUG]
[org.gradle.api.internal.artifacts.repositories.ExternalResourceResolver]
Unable to list versions for commons-beanutils#commons-beanutils;1.8.+:
pattern=<a href="https://COMPANY/repository/trunk/ivyrepo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" target="_blank">https://COMPANY/repository/trunk/ivyrepo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper]
ivy: no ivy file nor artifact found for
commons-beanutils#commons-beanutils;1.8.+
[DEBUG]
[org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DependencyResolverAdapter]
Performed resolved of module 'commons-beanutils#commons-beanutils;1.8.+' in
repository 'ivy': not found

--
View this message in context: http://gradle.1045684.n5.nabble.com/Can-not-resolve-artifacts-with-dynamic-revisions-from-Ivy-repository-tp5680421p5691212.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

   http://xircles.codehaus.org/manage_email





--
Darrell (Daz) DeBoer
Principal Engineer, Gradleware 
http://www.gradleware.com


Reply | Threaded
Open this post in threaded view
|

Re: Can not resolve artifacts with dynamic revisions from Ivy repository

Milan Papzilla
Ok Daz thank you.
I will keep my eyes on GRADLE-2318.

--
View this message in context: http://gradle.1045684.n5.nabble.com/Can-not-resolve-artifacts-with-dynamic-revisions-from-Ivy-repository-tp5680421p5709816.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email