japicmp
                                
                                 japicmp copied to clipboard
                                
                                    japicmp copied to clipboard
                            
                            
                            
                        Implement usage of SemVer ordering rules for resolving previous artifact
As title says, makes it so that resolving the previous artifact follows the ordering rules defined in SemVer 2.0.0 specification ( http://semver.org/spec/v2.0.0.html ).
Not complete yet : I'm planning to add some JUnits on the JApiCmpMojo to validate the changes better, and probably to improve management of error cases. Still, I wanted to open the PR to get feedback on the principle before finalising everything :-)
Basically :
- Extends SemanticVersion class with ability to parse according to the spec, and implement Comparable following the spec's rules.
- Create SemanticArtifactVersion implementing Maven's ArtifactVersion interface.
- Do some crazy stuff to get these SemanticArtifactVersion inside the maven version range used for comparison.
- Add a plugin parameter (false by default) to enable this behaviour.
Also, one point to note : I added dependency in test scope to hamcrest matchers in order for my JUnit to use assertThat cleanly, being consistent with your JUnits. If you are unhappy with the dependency addition, I could rewrite the tests to use good old assertTrue, it's not a big deal :-)
Thank you for providing a pull request. Your implementation looks fine. I would merge the PR once it is finished. Please also extend the documentation under src/site/markdown.
Thanks for the feedback, and sorry for the late answer :-) I'll do that as soon as I get a bit of time.
@UnasZole may I help you to complete the PR?