Groovy
  1. Groovy
  2. GROOVY-3846

Grape command cannot remove and/or update a "grape"

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8-rc-1, 1.7.9
    • Component/s: Grape
    • Labels:
      None
    • Environment:
      Groovy Trunk 2009-10-26T09:00+00:00

      Description

      The grape command has options to install and list the currently installed "grapes". It needs an option to remove a "grape" as well.

      The problem of the moment is pre-release snapshot software, e.g. groovyx.gpars:gpars:0.9-beta-1-SNAPSHOT. I keep updating this in my Maven cache but Grape never sees that it needs to re-grab from the Maven cache to the Grape cache. Currently I have to manually delete the files in teh Grape cache – which is silly.

      Alternatively this could be seen as a bug in that Grape has no way of checking to see if it needs to do an update – it assumes the version number uniquely determines a jar, which is simply not true for SNAPSHOTs.

        Activity

        Hide
        Paul King added a comment -

        proposed change added

        Show
        Paul King added a comment - proposed change added
        Hide
        Paul King added a comment -

        Russel, any chance you can try out the patch? See if it solves your problem? I think it is about the best we can do without continuing to push Ivy to have such functionality built-in.

        Show
        Paul King added a comment - Russel, any chance you can try out the patch? See if it solves your problem? I think it is about the best we can do without continuing to push Ivy to have such functionality built-in.
        Hide
        Paul King added a comment -

        Attaching revised patch which processes the artifact entries in the ivy-version.xml file.

        Show
        Paul King added a comment - Attaching revised patch which processes the artifact entries in the ivy-version.xml file.
        Hide
        Paul King added a comment - - edited

        Interim potential patch - adds a "grape uninstall" command-line option. With some shortcomings:

        • Doesn't parse content inside ivy-version.xml file which contains the real published artifact names; it just uses the common hard-coded filename pattern at the moment (which means it won't work with time stamped SNAPSHOT files currently)
        • Not as configurable as it could be - e.g. uses some hard-coded patterns for finding the ivy-version file (but we do this elsewhere currently anyway)
        • Currently doesn't do transitive dependencies (which might be dangerous anyway)
        • We could add bells and whistles: make version optional (removes multiple versions), support classifier
        • We could clean up more rigorously, e.g. remove ivydata props files, remove *.xml.original files

        Of these, at least the first should be fixed before applying.

        Show
        Paul King added a comment - - edited Interim potential patch - adds a "grape uninstall" command-line option. With some shortcomings: Doesn't parse content inside ivy-version.xml file which contains the real published artifact names; it just uses the common hard-coded filename pattern at the moment (which means it won't work with time stamped SNAPSHOT files currently) Not as configurable as it could be - e.g. uses some hard-coded patterns for finding the ivy-version file (but we do this elsewhere currently anyway) Currently doesn't do transitive dependencies (which might be dangerous anyway) We could add bells and whistles: make version optional (removes multiple versions), support classifier We could clean up more rigorously, e.g. remove ivydata props files, remove *.xml.original files Of these, at least the first should be fixed before applying.
        Hide
        Bob Swift added a comment -

        I would like to see a force (or replace) option on grape install that would download and replace an existing jar.

        Show
        Bob Swift added a comment - I would like to see a force (or replace) option on grape install that would download and replace an existing jar.
        Hide
        malbery added a comment -

        See comments of GROOVY-3819. I suspect that both issues can be resolved.

        Show
        malbery added a comment - See comments of GROOVY-3819 . I suspect that both issues can be resolved.
        Hide
        malbery added a comment -

        Relates to GROOVY-3819.

        Show
        malbery added a comment - Relates to GROOVY-3819 .
        Hide
        Roshan Dawrani added a comment -

        Russel, wanted to check if you are looking for removal of grapes individually or in a transitive manner.

        Since lower level dependencies may be shared across higher level grapes, it may be difficult to traverse the whole dependency tree across grapes to figure out if it's safe to do the removal of a selected grape or not.

        But, if it is just an individual grape's removal, then it may be a smaller thing to handle, and I will be keen on looking into Ivy/Gradle sides of it and see if groovy can also provide that option.

        Let me know what if a single removal will start helping you at this point?

        Show
        Roshan Dawrani added a comment - Russel, wanted to check if you are looking for removal of grapes individually or in a transitive manner. Since lower level dependencies may be shared across higher level grapes, it may be difficult to traverse the whole dependency tree across grapes to figure out if it's safe to do the removal of a selected grape or not. But, if it is just an individual grape's removal, then it may be a smaller thing to handle, and I will be keen on looking into Ivy/Gradle sides of it and see if groovy can also provide that option. Let me know what if a single removal will start helping you at this point?
        Hide
        Russel Winder added a comment -

        I haven't checked the Grape code, but I don't think Gradle suffers this problem – but I guess this needs checking. If this is an Ivy problem then whatever Gradle does to circumvent it, Grapes needs to do the same. If it isn't an Ivy problem then Grapes just needs fixing.

        So all in all the Grapes code needs work.

        Show
        Russel Winder added a comment - I haven't checked the Grape code, but I don't think Gradle suffers this problem – but I guess this needs checking. If this is an Ivy problem then whatever Gradle does to circumvent it, Grapes needs to do the same. If it isn't an Ivy problem then Grapes just needs fixing. So all in all the Grapes code needs work.
        Hide
        Jochen Theodorou added a comment -

        Is this really a grape issue or is it related to ivy?

        Show
        Jochen Theodorou added a comment - Is this really a grape issue or is it related to ivy?

          People

          • Assignee:
            Paul King
            Reporter:
            Russel Winder
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development