Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6432

Space in <mirrorOf /> silently disables mirror

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Later
    • 3.0.5, 3.3.9, 3.5.2
    • None
    • Settings
    • Maven 3.5.2 (Red Hat 3.5.2-5 on Fedora 28).
      and
      Maven 3.0.5 (Red Hat 3.0.5-17 on RHEL 7.5)
      and
      Maven 3.3.9 on RHEL 7.5

    Description

       

      Maven silently ignores mirror configuration when there is a space in mirrorOf. This could be a major problem if the developer's mirror configuration is critical and this causes her to not notice that the mirror is disabled.

      Without space inside mirrorOf, the mirror setting is respected.

      <settings>
        <mirrors>
          <mirror>
            <id>loopback</id>
            <name>loopback</name>
            <url>http://127.0.0.1</url>
            <mirrorOf>!my-repo,*</mirrorOf>
          </mirror>
        </mirrors>
      </settings>
      
      [INFO] Scanning for projects...
      [INFO] 
      [INFO] ------------------------------------------------------------------------
      [INFO] Building mirrorOf-test 1
      [INFO] ------------------------------------------------------------------------
      Downloading from loopback: http://127.0.0.1/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
      

       

      With a space after the comma in mirrorOf, the mirror is ignored without warning.

      <settings>
        <mirrors>
          <mirror>
            <id>loopback</id>
            <name>loopback</name>
            <url>http://127.0.0.1</url>
            <mirrorOf>!my-repo, *</mirrorOf>
          </mirror>
        </mirrors>
      </settings>
      
      [INFO] Scanning for projects...
      [INFO] 
      [INFO] ------------------------------------------------------------------------
      [INFO] Building mirrorOf-test 1
      [INFO] ------------------------------------------------------------------------
      Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
      ...
      

       

      The problem is reproducible with minimal pom.xm

      <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.example</groupId>
        <artifactId>mirrorOf-test</artifactId>
        <version>1</version>
      </project>
      

       

      Attachments

        1. Possible list of hits.png
          34 kB
          Michael Osipov

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              ew Elias Elmqvist Wulcan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m