Updating Version In
|Goal details page: here|
Revapi needs two artifacts to compare against each other to determine the API differences and therefore the required version changes. By default the new artifact is the project being built so the artifacts need to be actually produced prior to running revapi. This is usually done in the
package phase, which is therefore run prior to any Revapi goal.
When updating the version, the plugin takes into consideration the configuration of Revapi as declared in the
pom.xml but does not use certain extensions that would make some of the differences disappear (like the semver-ignore extension). This list of extensions is configurable using the
disallowedExtensions configuration property, see the goal’s detail page for further info.
For a single-module project, updating the versions is very simple:
pom.xml will be updated according to the API changes and the semantic versioning rules.
For multi-module project, one has more options. If each of the modules in the project is independently versioned, then the invocation is the same as for the single-module project, but if you version the child modules uniformly with the parent (i.e. you set
true when releasing using the maven release plugin), you should set the
singleVersionForAllModules of revapi to
true, too. Generally,
singleVersionForAllModules should be set to the same value.
mvn revapi:update-versions -Drevapi.singleVersionForAllModules=true
This will check the API differences in all the child modules and will determine the version of the whole based on the "biggest" change. I.e. if one child module breaks the API then the major version will be increased in all modules even though the rest of the child modules might not have changed at all.