Open psiroky opened 9 years ago
Nice idea, this is definitely doable using a custom reporter for Revapi.
Basically this would be a new extension that would implement the https://github.com/revapi/revapi/blob/master/revapi/src/main/java/org/revapi/Reporter.java interface, packaged in a separate jar and put as a dependency of the revapi maven plugin.
You would be able to configure it inside the "analysisConfiguration" section of the revapi maven plugin's configuration.
In addition, for the maven plugin to do what you want, we would need to teach it to not fail on any kind of API problem (this cannot be done atm).
Thanks for a quick response! I will try to look at this when I find some spare time...
Maven plugin 0.3.9
has just been released with the ability to not fail on errors. If you are planning to work or actually already are working on this, you can use that version.
Note that this should be easily implementable with revapi-reporting-text:0.5.0
, once its released, using a custom FreeMarker template that would build the xml report for you. See commit 4eb43fb73e0be7e35f577853d22ba90f4e6a7ac1.
revapi-reporter-text:0.5.0
(notice the artifact ID which is different from what it used to be) has been released and I hope this is doable using a FreeMarker template. If not, we can always implement a new reporter with the full power of Java.
Thanks for the info. My original idea was to use the surefire-common
classes, similar as in here https://github.com/thradec/redhat-repository-validator/blob/master/src/main/java/com/redhat/repository/validator/impl/SurefireXmlReporter.java. But the FreeMarker sounds interesting as well.
However, I am not sure when I will be able to look at this...
We use the
revapi-maven-plugin
and execute it as part of Maven build in Jenkins. When there are incompatibilities found, the whole build will fail (Jenkins marks that with red color).It would great if the plugin (or directly revapi) could report the fails as failed test cases in the JUnit compatible format, so that Jenkins could pick that up and create nice report. Then Jenkins would mark the build as unstable (yellow) instead of failed (red). This would make it easy to see if the build failed because of some maven related error, or because some of the checks failed (e.g. revapi, animal-sniffer, etc).
Here is some info about how the JUnit XML format looks: http://stackoverflow.com/questions/4922867/junit-xml-format-specification-that-hudson-supports