Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

AdoptOpenJDK/jdk-api-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARN - PROJECT IS RETIRED

Please note this project has been retired in favour of https://javaalmanac.io/jdk/21/.


JDK API Diff Report Generator

This project creates a report of all API changes between two different JDK versions, using JapiCmp. You can use this tool for instance to compare OpenJDK 9 and OpenJDK 10, OpenJDK 9 and Oracle JDK 9 etc.

Published reports

Example reports created by this generator can be found in the docs directory:

N => N+1

LTS => LTS+1

LTS => LTS+2

Some of them are huge, so loading may take a bit.

Usage

To create reports yourself, e.g. with different settings, run mvn clean install. The API change report can be found at target/jdk-api-diff.html.

Maven Toolchains are used to locate the JDKs to compare. There must be a toolchain entry of type jdk for each JDK to compare. Provide a file ~.m2/toolchains.xml like this:

<?xml version="1.0" encoding="UTF8"?>
<toolchains>
    <toolchain>
        <type>jdk</type>
        <provides>
            <version>9</version>
            <vendor>openjdk</vendor>
        </provides>
        <configuration>
            <jdkHome>/path/to/jdk-9</jdkHome>
        </configuration>
    </toolchain>
    <toolchain>
        <type>jdk</type>
        <provides>
            <version>10</version>
            <vendor>openjdk</vendor>
        </provides>
        <configuration>
            <jdkHome>/path/to/jdk-10</jdkHome>
        </configuration>
    </toolchain>
</toolchains>

Specify two properties, jdk1 and jdk2 in your pom.xml, identifying the base and target JDK version for the comparison. The values are comma-separated requirements matched against the <provides> configurations of the existing toolchain entries. Both properties must unambiguously identify one toolchain, for example:

<jdk1>version=9,vendor=openjdk</jdk1>
<jdk2>version=10,vendor=openjdk</jdk2>

If there's no matching toolchain or multiple ones match the given requirements, an exception will be raised.

The report is created via the ModuleRepackager class which is executed with the Maven exec plug-in. Adjust the following options passed to that class in pom.xml as needed:

  • --exported-packages-only: true or false, depending on whether only exported packages should be compared or all packages; only applies if both compared versions are Java 9 or later
  • --excluded-packages: a comma-separated listed of package names which should be excluded from the comparison; this can be useful to exclude unsupported packages such as com.apple or to ignore packages missing from Oracle EA builds but present in final versions such as jdk.management.jfr

License

This project is licensed under the Apache License version 2.0.

About

Creates a report of all API changes two JDK versions

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published