Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6177

Version number cannot contain 2 hyphens

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Minor
    • None
    • None
    • None
    • None
    • Not relevant

    Description

      Hi,

      we are finishing a magnolia based project recently, but there is a problem on the release process that magnolia doesn't allow version number with two hyphens and always considers everything after the first hyphen is the classifier.

      here is a code snippet from info.magnolia.module.model.Version

      final int classifierIdx = versionStr.indexOf('-');
              if (classifierIdx > 0) {
                  classifier = versionStr.substring(classifierIdx + 1);
                  if (!classifierValidation.matcher(classifier).matches()) {
                      throw new IllegalArgumentException("Invalid classifier: \"" + classifier + "\" in version \"" + versionStr + "\"");
                  }
                  numbers = versionStr.substring(0, classifierIdx);
              }
      

      I suggest change

      final int classifierIdx = versionStr.indexOf('-');
      

      to

      final int classifierIdx = versionStr.lastIndexOf('-');
      

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              gjoseph Magnolia International
              jaiwo99 Liang Shi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD