You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem with parsing Maven paths with tar.bz2 type/extension #96
See the code i pasted (last method): first strip off known hashes, then strips off known prefix (artifactId + version) and then IF you assume classifier does not have dot (and maven would not allow it: ), everything "dotted" is extension. That code above works for cases like "tar.gz", "tar.bz2" etc.
Activity
grgrzybek commentedon Aug 2, 2023
What's worse, is that normal artifacts like this won't work as well:
grgrzybek commentedon Aug 2, 2023
I'd rather assume that classifier doesn't contain dots, but it may contain dashes - see https://repo1.maven.org/maven2/org/apache/activemq/activemq-karaf/5.18.2/ with classifiers like
activemq-webconsoleorfeatures-core.cstamas commentedon Aug 2, 2023
Yes, if classifier contains dots, you are doomed 😄
But, you KNOW what is prefix (artifactId + version), strip that off, what remains is (possibly) classifier and extension. For example, this is what happens in indexer (does NOT work if classifier contains dot):
https://github.com/apache/maven-indexer/blob/master/search-backend-remoterepository/src/main/java/org/apache/maven/search/backend/remoterepository/extractor/ResponseExtractorSupport.java
grgrzybek commentedon Aug 2, 2023
thanks for comment - Github is a small place ;)
the problem is how to split classifier +
.+ multidotted-extension...cstamas commentedon Aug 2, 2023
See the code i pasted (last method): first strip off known hashes, then strips off known prefix (artifactId + version) and then IF you assume classifier does not have dot (and maven would not allow it: ), everything "dotted" is extension. That code above works for cases like "tar.gz", "tar.bz2" etc.
Debug this UT https://github.com/apache/maven-indexer/blob/master/search-backend-remoterepository/src/test/java/org/apache/maven/search/backend/remoterepository/internal/RemoteRepositorySearchBackendImplTest.java#L166