Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix maven2 path has double hash extension or .asc mix with hash extension parse error #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EdmondFrank
Copy link

@EdmondFrank EdmondFrank commented Oct 28, 2020

The url resource for test:

https://repo1.maven.org/maven2/com/netflix/spectator/spectator-ext-jvm/0.103.0/spectator-ext-jvm-0.103.0.module.md5.asc

Here is the exception log:

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)

In my opinion, this pr may be the smallest change of code, but maybe not the best solution.

If you have some other ideas, welcome to discuss with me.

I also create a issue at MVN JIRA: https://issues.sonatype.org/browse/NEXUS-25645

Thanks for review.

@wwannemacher
Copy link

to note for any devs that have a look at this - @EdmondFrank has signed the CLA already on another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants