Class Maven2GemVersionConverter


  • public class Maven2GemVersionConverter
    extends java.lang.Object
    Class doing conversion from Maven "versioning space" into Ruby Gems "versioning space". The job is not trivial, since Maven is much more liberal in accepting versions then Gems are.
    Author:
    cstamas, mkristian
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DUMMY_PREFIX  
      static java.lang.String DUMMY_VERSION  
      static java.util.regex.Pattern gemVersionPattern
      This is the pattern we match against.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String createGemVersion​(java.lang.String mavenVersion)
      Creates valid GEM version out of Maven2 version.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • gemVersionPattern

        public static final java.util.regex.Pattern gemVersionPattern
        This is the pattern we match against. This is actually x.y.z... version format, that RubyGems 1.3.5 support. {@link http://github.com/jbarnette/rubygems/blob/REL_1_3_5/lib/rubygems/version.rb} and ://github.com/jbarnette/rubygems/blob/REL_1_3_6/lib/rubygems/version.rb
    • Constructor Detail

      • Maven2GemVersionConverter

        public Maven2GemVersionConverter()
    • Method Detail

      • createGemVersion

        public java.lang.String createGemVersion​(java.lang.String mavenVersion)
                                          throws java.lang.NullPointerException
        Creates valid GEM version out of Maven2 version. Gem versions are "stricter" than Maven versions: they are in form of "x.y.z...". They have to start with integer, and be followed by a '.'. You can have as many like these you want, but Maven version like "1.0-alpha-2" is invalid Gem version. Hence, some trickery has to be applied.
        Parameters:
        mavenVersion -
        Returns:
        Throws:
        java.lang.NullPointerException