Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-25645

maven2 path parse error when path has double hash extension or .asc mix with hash extension

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.27.0
    • Fix Version/s: None
    • Component/s: Maven
    • Labels:
    • Environment:
      Nexus OSS 3.27.0-03
      Ubuntu 18.04 LTS

      Description

      Here is the exception log when nexus try to cache https://repo1.maven.org/maven2/com/netflix/spectator/spectator-ext-jvm/0.103.0/spectator-ext-jvm-0.103.0.module.md5.asc

      2020-10-28 10:57:58,623+0800 WARN [qtp716471188-527] *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /maven2/com/netflix/spectator/spectator-ext-jvm/0.103.0/spectator-ext-jvm-0.103.0.module.md5.asc java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1967) at org.sonatype.nexus.repository.maven.MavenPath.subordinateOf(MavenPath.java:288) at org.sonatype.nexus.repository.maven.MavenPath.main(MavenPath.java:265) at org.sonatype.nexus.repository.maven.internal.Maven2MavenPathParser.isRepositoryMetadata(Maven2MavenPathParser.java:70) at org.sonatype.nexus.repository.maven.internal.orient.MavenProxyFacet.getCacheController(MavenProxyFacet.java:79) at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.fetch(ProxyFacetSupport.java:440) at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.fetch(ProxyFacetSupport.java:402) at org.sonatype.nexus.repository.maven.internal.orient.MavenProxyFacet.fetch(MavenProxyFacet.java:74) at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.doGet(ProxyFacetSupport.java:269) at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.lambda$1(ProxyFacetSupport.java:245) at org.sonatype.nexus.common.io.CooperatingFuture.performCall(CooperatingFuture.java:122) at org.sonatype.nexus.common.io.CooperatingFuture.call(CooperatingFuture.java:64) at org.sonatype.nexus.common.io.ScopedCooperationFactorySupport$ScopedCooperation.cooperate(ScopedCooperationFactorySupport.java:99)
      

      After look up the source , i found main reason is that plugins/nexus-repository-maven/src/main/java/org/sonatype/nexus/repository/maven/internal/Maven2MavenPathParser.java no handle this case. so i try to take a pull request to solve this problem.

      Here is my PR url: https://github.com/sonatype/nexus-public/pull/80
       
       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            EdmondFrank Edmond Frank
            Last Updated By:
            Joe Tom Joe Tom
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title