So, I'm looking at Maven's Version Spec and if it's written and I'm understanding it correctly. Build Information has to be -<build> instead of +<build>. I know this doesn't match the semver spec. It might be nice to be able to specify some kind of Formatter class to allow getVersion to print something else. For example
new Semver(...).withType(Type.MAVEN)
given build information it could use - instead, and maybe this could be used in some cases to detect whether a SNAPSHOT should be added (although maybe that's too error prone).
note: In my case I've just decided to create a subclass of Semver overriding getVersion super.getVersion().replace("+", "-")
So, I'm looking at Maven's Version Spec and if it's written and I'm understanding it correctly. Build Information has to be
-<build>instead of+<build>. I know this doesn't match the semver spec. It might be nice to be able to specify some kind of Formatter class to allowgetVersionto print something else. For examplegiven build information it could use
-instead, and maybe this could be used in some cases to detect whether aSNAPSHOTshould be added (although maybe that's too error prone).note: In my case I've just decided to create a subclass of
SemveroverridinggetVersionsuper.getVersion().replace("+", "-")