Maven
  1. Maven
  2. MNG-3461

Enhance Mirror definition syntax

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.8
    • Fix Version/s: 2.0.9
    • Labels:
      None
    • Number of attachments :
      1

      Description

      I ran into some issues recently with the IT tests. I use a mirrorof * to redirect everything to a repo manager but this is also redirecting the file based repositories. I can't think of any good reason this should apply to anything other than remote repos. I have two proposals:

      1. Change maven so that file based repos ignore all mirror settings

      2. Change maven so that file based repos ignore the wildcard but
      will respond if the mirror specifically names it.

      I can't think of any reason why a mirror should override a local repo so I suggest we go with #1.

      1. mng-3461.diff
        12 kB
        brianfox brianfox

        Issue Links

          Activity

          Hide
          Carlos Sanchez added a comment -

          #2 if I explicitly want to mirror a file repo I should be able to

          Show
          Carlos Sanchez added a comment - #2 if I explicitly want to mirror a file repo I should be able to
          Hide
          brianfox brianfox added a comment -

          I guess I can live with that. The reason I was thinking of still skipping the file ones is that you may have a name conflict and you didn't mean the one with the file, but the one with the http.

          Show
          brianfox brianfox added a comment - I guess I can live with that. The reason I was thinking of still skipping the file ones is that you may have a name conflict and you didn't mean the one with the file, but the one with the http.
          Hide
          John Casey added a comment -

          IMO it's really unfortunate that we started using regex-like syntax for mirrorOf in the first place. Having reserve words instead, like 'all' or 'external', would be better since it would allow flexibility to expand in precisely this way. I'd be in favor of an 'external:*' syntax to mean anything not on this machine (using file:// or localhost as the host would be "this machine" IMO).

          Maybe we can start introducing these reserved words now?

          Show
          John Casey added a comment - IMO it's really unfortunate that we started using regex-like syntax for mirrorOf in the first place. Having reserve words instead, like 'all' or 'external', would be better since it would allow flexibility to expand in precisely this way. I'd be in favor of an 'external:*' syntax to mean anything not on this machine (using file:// or localhost as the host would be "this machine" IMO). Maybe we can start introducing these reserved words now?
          Show
          John Casey added a comment - Link to proposal: http://docs.codehaus.org/display/MAVEN/Mirror+Settings+and+File+repositories
          Hide
          brianfox brianfox added a comment -

          Patch to implement the proposal. I used the new syntax locally and ran the ITs with no problems. (meaning it didn't interfere with the file repos as intended)

          Show
          brianfox brianfox added a comment - Patch to implement the proposal. I used the new syntax locally and ran the ITs with no problems. (meaning it didn't interfere with the file repos as intended)
          Hide
          brianfox brianfox added a comment -

          please peer review patch..

          Show
          brianfox brianfox added a comment - please peer review patch..
          Hide
          brianfox brianfox added a comment -

          uploading new patch, avoided the complete reformatting.

          Show
          brianfox brianfox added a comment - uploading new patch, avoided the complete reformatting.
          Hide
          John Casey added a comment -

          I've reviewed the patch, and all looks good with it. I think even UNC paths will work out alright here, since you have to provide a protocol for the repository to work. In UNC cases, this would be 'file://' which would mean that the \\server\path\to\repo UNC path should render 'server' as the host name, which is != localhost, and therefore matches external:*.

          Show
          John Casey added a comment - I've reviewed the patch, and all looks good with it. I think even UNC paths will work out alright here, since you have to provide a protocol for the repository to work. In UNC cases, this would be 'file://' which would mean that the \\server\path\to\repo UNC path should render 'server' as the host name, which is != localhost, and therefore matches external:*.

            People

            • Assignee:
              brianfox brianfox
              Reporter:
              brianfox brianfox
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: