Package de.saumya.mojo.gems
Class Maven2GemVersionConverter
- java.lang.Object
-
- de.saumya.mojo.gems.Maven2GemVersionConverter
-
public class Maven2GemVersionConverter extends java.lang.ObjectClass 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.StringDUMMY_PREFIXstatic java.lang.StringDUMMY_VERSIONstatic java.util.regex.PatterngemVersionPatternThis is the pattern we match against.
-
Constructor Summary
Constructors Constructor Description Maven2GemVersionConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateGemVersion(java.lang.String mavenVersion)Creates valid GEM version out of Maven2 version.
-
-
-
Field Detail
-
DUMMY_VERSION
public static final java.lang.String DUMMY_VERSION
- See Also:
- Constant Field Values
-
DUMMY_PREFIX
public static final java.lang.String DUMMY_PREFIX
- See Also:
- Constant Field Values
-
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
-
-
Method Detail
-
createGemVersion
public java.lang.String createGemVersion(java.lang.String mavenVersion) throws java.lang.NullPointerExceptionCreates 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
-
-