https://github.com/openhft/binary-compatibility-enforcer-plugin
Wraps the Java API ComplianceChecker into a maven plugin
https://github.com/openhft/binary-compatibility-enforcer-plugin
Last synced: 8 months ago
JSON representation
Wraps the Java API ComplianceChecker into a maven plugin
- Host: GitHub
- URL: https://github.com/openhft/binary-compatibility-enforcer-plugin
- Owner: OpenHFT
- License: gpl-3.0
- Created: 2020-11-28T22:30:20.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-30T17:30:13.000Z (almost 2 years ago)
- Last Synced: 2024-01-31T19:01:07.024Z (almost 2 years ago)
- Language: Java
- Size: 326 KB
- Stars: 7
- Watchers: 14
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: ReadMe.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Overview
This is a maven plugin that wraps - https://github.com/lvc/japi-compliance-checker
This plugin uses the perl scripts and components of japi-compliance-checker directly. So japi-compliance-checker has to be installed and available on your $PATH.
NOTE: If this plugin is run on a machine where japi-compliance-checker is not installed. A warning message will be seen, highlighting that the japi-compliance-checker is not available.
=== What it does
It allows us to better detect breaking changes of binary compatibility, this plugin enforces, that we only allow these changes, when there has been a change to the "MinorVersion”.
The above is assuming the following maven version format : ( see also https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8855)
..
NOTE: No validation is carried out if the current version is `..0` or `..0-SNAPSHOT`
= OS supported
* Mac
* Linux
Not supported yet
* Windows
= Install
* JDK or OpenJDK - development files
* Maven
* Perl 5
* https://github.com/lvc/japi-compliance-checker#install
[source,shell script]
----
$git clone git@github.com:lvc/japi-compliance-checker.git
$cd japi-compliance-checker/
[source,shell script]
----
== Linxu
```
sudo make install prefix=/usr
```
== Mac
=== Permissions
set the approximate permission
[source,shell script]
----
$chmod -R 775
----
=== Link
```
ln -s japi-compliance-checker.pl japi-compliance-checker
```
=== Path
Add the japi-compliance-checker to your path
for example on a mac if you have installed it to ~//japi-compliance-checker
[source,shell script]
----
$vi ~/.profile
----
add the following:
[source,shell script]
----
export PATH="$PATH:~//japi-compliance-checker"
----
= Configuration
|===
| parameter | default value | Example | Required / Optional
| referenceVersion
| ..0
| 5.20.120
| optional
| artifactsURI
|
| https://teamcity.chronicle.software/repository/download
| optional
| expression
| japi-compliance-checker -lib %s %s %s -report-path %s
|
| optional
| binaryCompatibilityPercentageRequired
| 100
|
| optional
| reportLocation
| target
|
| optional
|===
=== Reference Version
If you specify a reference version this will be used instead of the default reference version. If the reference version you provide is not availible in maven central, an error will be reported.
Hence if no reference version is provided then the default version is used. The default version is ..0 version, for example assume that you where on 5.20.143-SNAPSHOT then this would be checked ( by default ) against 5.20.0, If 5.20.0 does not exist in maven central, then an error will be reported.
=== Expression
`japi-compliance-checker -lib %s %s %s`
the `%s` are defind in the following order:
* name - the artifact name
* first jar - reference version
* second jar - current project version
These jar will be resolved at runtime of the plugin.
This `expression`, is the expression that is passed directly to japi-compliance-checker, for more information on the options see https://github.com/lvc/japi-compliance-checker, or run:
[source,shell script]
----
japi-compliance-checker -help
----
=== ArtifactsURI
Used to host the error report on a teamcity server, see section below on Teamcity.
=== Binary Compatibility Percentage Required
When the `japi-compliance-checker` is run, it provides the `binary compatibility` as a percentage, if the percentage that is reported is lower than the `binaryCompatibilityPercentageRequired`, the validation will fail and a link will be provided to an html a report. By default the `binaryCompatibilityPercentageRequired` is set to 100%.
== Maven
[source,xml]
----
software.chronicle
binary-compatibility-enforcer-plugin
1.0.0
verify
enforcer
2.20.2
japi-compliance-checker -lib %s %s %s
----
== Teamcity
If you are using teamcity, then to host the report on your teamcity server you should set `**/compat_report.html` in the following ( see example ):
image::/docs/images/teamcity.png[]
and set add the following to your config
```
```
for example:
```
net.openhft
binary-compatibility-enforcer-plugin
1.0.3
verify
enforcer
1.7.12
https://teamcity.chronicle.software/repository/download
```
for example like this
image::/docs/images/html-report.png[]
If you set the `artifactsURI` configuration and you are not running on teamcity this setting will be ignored.