-
Notifications
You must be signed in to change notification settings - Fork 14
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
Problem with parsing Maven paths with tar.bz2 type/extension #96
Comments
What's worse, is that normal artifacts like this won't work as well: @Test
public void matchNormalClassifier3()
{
String path = "/commons-x/commons-x/1/commons-x-1-sources.jar.sha1";
ArtifactPathInfo pathInfo = ArtifactPathInfo.parse( path );
assertThat( pathInfo.getVersion(), equalTo( "1" ) );
assertThat( pathInfo.getClassifier(), equalTo( "sources" ) );
assertThat( pathInfo.getType(), equalTo( "jar.sha1" ) );
}
|
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 |
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): |
thanks for comment - Github is a small place ;) the problem is how to split classifier + |
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. |
with 4e0daa5 reverted, my test (in
org.commonjava.atlas.maven.ident.util.ArtifactPathInfoTest
) works:otherwise, the type is
bz2
and the classifier ism2.tar
The text was updated successfully, but these errors were encountered: