[ https://issues.apache.org/jira/browse/MINDEXER-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15069600#comment-15069600 ]
ASF GitHub Bot commented on MINDEXER-49: ---------------------------------------- GitHub user cthiebault opened a pull request: https://github.com/apache/servicemix/pull/41 Don't use dot for Maven classifier Because it is not well supported by Maven and repositories like Nexus & Artifactory: they are not able to guess GAV. See * https://issues.apache.org/jira/browse/MINDEXER-49 * https://issues.sonatype.org/browse/NEXUS-6587 * https://www.jfrog.com/jira/browse/RTFACT-5971 * https://www.jfrog.com/jira/browse/RTFACT-8845 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cthiebault/servicemix dont-use-dot-for-maven-classifier Alternatively you can review and apply these changes as the patch at: https://github.com/apache/servicemix/pull/41.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #41 ---- commit 10f362b96451ba836ea0b414b422864fe0c6000e Author: Cedric Thiebault <cedric.thieba...@crossing-tech.com> Date: 2015-12-23T12:52:47Z Don't use dot for Maven classifier because it is not well supported by Maven and repositories like Nexus & Artifactory: they are not able to guess GAV. See * https://issues.apache.org/jira/browse/MINDEXER-49 * https://issues.sonatype.org/browse/NEXUS-6587 * https://www.jfrog.com/jira/browse/RTFACT-5971 * https://www.jfrog.com/jira/browse/RTFACT-8845 ---- > M2GavCalculator does not parse GAV correctly for classifiers with dots > ---------------------------------------------------------------------- > > Key: MINDEXER-49 > URL: https://issues.apache.org/jira/browse/MINDEXER-49 > Project: Maven Indexer > Issue Type: Bug > Affects Versions: 4.1.1, 4.1.2 > Environment: all > Reporter: René Zanner > Priority: Critical > > When having a classifier with dots (classifier.with.dots) and an extension > with or without dots (e.g. tar.gz), the calculation of Gav changes classifier > and type/extension to something clearly not intended: > || ||Attached artifact definition||M2GavCalculator result|| > ||classifier|classifier.with.dots|classifier| > ||extension/type|tar.gz|with.dots.tar.gz| > The problem seems to be located in lines 136ff, 175ff *and* 216ff (do you > have a code duplication issue as well? ;-) ): > {code} > int nExtPos = tail.indexOf( '.' ); > ... > ext = tail.substring( nExtPos + 1 ); > classifier = tail.charAt( 0 ) == '-' ? tail.substring( 1, nExtPos ) : null; > {code} > This code assumes that the classifier ends at the first dot in the "tail" > (which is everything after the version number). > Since Maven allows dots in classifiers _as well as in extensions_, the > parsing has to be made more intelligent. So, it is not enough to just turn > the parsing around and use the part after the last dot as extension and > before it as classifier (that's why I used the 'tar.gz' extension in my > example above). > I do not have a solution for this except checking for well-known extensions > (tar.gz, xml, jar, zip, a.s.o.) and build the classifier/extension parsing > around it. -- This message was sent by Atlassian JIRA (v6.3.4#6332)