Grails

Transitive dependencies not being resolved

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.2-M4
  • Fix Version/s: 1.2-RC1
  • Component/s: None
  • Description:
    Hide

    When using a local resolver mavenLocal() and/or pom resolver, any dependencies that are stored in the local maven repository ~/.m2 are resolved, but their transitive dependencies are not.

    This is very crucial I think, especially when working in an environment when local modules are used. For example in many projects, you'll have a few components build using maven and they are installed locally during install phase. Maven resolves those correctly, along with their transitive dependencies. Grails/Ivy seems to not. At least the local file resolver and pom resolver seem to ignore transitive deps for any local packages.

    I added the mavenLocal() support back a few releases ago and I'd look into this issue, but I'm not sure if I'll have time. I think this is an ivy issue. Seems like file resolver doesn't enforce transitive dependencies. I'm wondering if we should use a different resolver? Maybe dual? I can't seem to find ivy documentation about this, so wondering if someone knows a bit more about how these resolvers work.

    Thanks.

    Ilya

    Show
    When using a local resolver mavenLocal() and/or pom resolver, any dependencies that are stored in the local maven repository ~/.m2 are resolved, but their transitive dependencies are not. This is very crucial I think, especially when working in an environment when local modules are used. For example in many projects, you'll have a few components build using maven and they are installed locally during install phase. Maven resolves those correctly, along with their transitive dependencies. Grails/Ivy seems to not. At least the local file resolver and pom resolver seem to ignore transitive deps for any local packages. I added the mavenLocal() support back a few releases ago and I'd look into this issue, but I'm not sure if I'll have time. I think this is an ivy issue. Seems like file resolver doesn't enforce transitive dependencies. I'm wondering if we should use a different resolver? Maybe dual? I can't seem to find ivy documentation about this, so wondering if someone knows a bit more about how these resolvers work. Thanks. Ilya
  1. deps_fix.patch
    (2 kB)
    Ilya Sterin
    25/Nov/09 1:50 PM

Activity

Hide
Ilya Sterin added a comment - 09/Nov/09 9:58 AM

Great, I'll test and submit a patch. Seems like that could be it.

Thanks Graeme.

Ilya

Show
Ilya Sterin added a comment - 09/Nov/09 9:58 AM Great, I'll test and submit a patch. Seems like that could be it. Thanks Graeme. Ilya
Hide
Graeme Rocher added a comment - 25/Nov/09 3:12 AM

Hi Ilya can you verify whether changing the pattern to:

localMavenResolver.addArtifactPattern(
                    "${repoPath}/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).pom")

Works for you?

Show
Graeme Rocher added a comment - 25/Nov/09 3:12 AM Hi Ilya can you verify whether changing the pattern to:
localMavenResolver.addArtifactPattern(
                    "${repoPath}/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).pom")
Works for you?
Hide
Ilya Sterin added a comment - 25/Nov/09 11:43 AM

Graeme, I tried this a few weeks ago with no luck. I haven't had the time to look into it. I tried it again, still no luck. It resolves the specified local dependency, but doesn't do anything to the transitive dependencies of that local dep.

I'll take a look. How much time do we have until you plan on 1.2 release? I'd really want this to get fixed before this. I'll try to figure this out today unless anything major happens at work.

Ilya

Show
Ilya Sterin added a comment - 25/Nov/09 11:43 AM Graeme, I tried this a few weeks ago with no luck. I haven't had the time to look into it. I tried it again, still no luck. It resolves the specified local dependency, but doesn't do anything to the transitive dependencies of that local dep. I'll take a look. How much time do we have until you plan on 1.2 release? I'd really want this to get fixed before this. I'll try to figure this out today unless anything major happens at work. Ilya
Hide
Ilya Sterin added a comment - 25/Nov/09 1:49 PM

Ok, I figured it out. I wish Ivy API was actually documented. After trying some combinations, it appears that it has to be a combination of ivy and artifact pattern. I'm attaching the patch.

Show
Ilya Sterin added a comment - 25/Nov/09 1:49 PM Ok, I figured it out. I wish Ivy API was actually documented. After trying some combinations, it appears that it has to be a combination of ivy and artifact pattern. I'm attaching the patch.
Hide
Ilya Sterin added a comment - 25/Nov/09 1:50 PM

Ok, here is the patch. It all works. You might have to clean your local ivy cache.

Show
Ilya Sterin added a comment - 25/Nov/09 1:50 PM Ok, here is the patch. It all works. You might have to clean your local ivy cache.
Hide
Graeme Rocher added a comment - 25/Nov/09 1:52 PM

Thanks, i'll make sure it gets into 1.2 final

Show
Graeme Rocher added a comment - 25/Nov/09 1:52 PM Thanks, i'll make sure it gets into 1.2 final
Hide
Graeme Rocher added a comment - 25/Nov/09 3:09 PM

Thanks for the patch

Show
Graeme Rocher added a comment - 25/Nov/09 3:09 PM Thanks for the patch

People

Dates

  • Created:
    08/Nov/09 7:44 PM
    Updated:
    25/Nov/09 3:09 PM
    Resolved:
    25/Nov/09 3:09 PM